Skip to content

Commit

Permalink
fix: handle undef, error...
Browse files Browse the repository at this point in the history
  • Loading branch information
Elin Angelow committed Apr 23, 2024
1 parent ab8a428 commit 51d55de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function mergeDeep(...objects) {
const isObject = obj => obj && typeof obj === 'object';

return objects.reduce((prev, obj) => {
Object.keys(obj).forEach(key => {
obj && Object.keys(obj).forEach(key => {
const pVal = prev[key];
const oVal = obj[key];

Expand Down
7 changes: 6 additions & 1 deletion lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ const Logger = ({
try {
return await super.send(data);
} catch (e) {
this.log('error', 'Send', e?.stack, data);
this.log(
'error',
'Send',
e?.error?.stack || e?.stack || e,
data
);
throw e;
}
}
Expand Down

0 comments on commit 51d55de

Please sign in to comment.