Skip to content

Commit

Permalink
fix(logger): catch errors when triggering error callback
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Sep 30, 2024
1 parent 6adaa0b commit c589921
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/logger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ export function logError(
metadata: err,
});

if (cb && isPromise) return cb(null, output);
if (cb && isPromise) {
try {
return cb(null, output);
} catch (e) {}

return;
}

console.error(output);
}
Expand Down

0 comments on commit c589921

Please sign in to comment.