Skip to content

Commit 6ce2041

Browse files
committed
fix: better error log style for uncaughtException
1 parent c6c45b6 commit 6ce2041

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/cli.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ export default async function main() {
9696
// globalOpts = cli.optsWithGlobals();
9797
}
9898

99-
main().catch((err) => {
99+
main().catch(onError);
100+
101+
process.on("uncaughtException", onError);
102+
103+
function onError(err: Error) {
100104
logger.error(err);
101105
exit(1);
102-
});
106+
}

0 commit comments

Comments
 (0)