Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

Commit c589921

Browse files
committed
fix(logger): catch errors when triggering error callback
1 parent 6adaa0b commit c589921

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/logger/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ export function logError(
3737
metadata: err,
3838
});
3939

40-
if (cb && isPromise) return cb(null, output);
40+
if (cb && isPromise) {
41+
try {
42+
return cb(null, output);
43+
} catch (e) {}
44+
45+
return;
46+
}
4147

4248
console.error(output);
4349
}

0 commit comments

Comments
 (0)