From 0e414527e4f8e7d2a40e0ae77cff507c930eb72e Mon Sep 17 00:00:00 2001 From: Marvin ROGER Date: Sat, 27 Jul 2024 12:11:10 +0200 Subject: [PATCH] Exit the process with error code when unhandled rejection --- commands/lib/log.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/lib/log.js b/commands/lib/log.js index b064ff8..a8d3893 100644 --- a/commands/lib/log.js +++ b/commands/lib/log.js @@ -13,13 +13,13 @@ process.on('uncaughtException', return } - setTimeout(() => { process.abort() }, 1000).unref() process.exit(1); }); process.on('unhandledRejection', (err) => { - log.error(err, 'Unhandled Promise Rejection'); + log.fatal(err, 'Unhandled Promise Rejection'); + process.exit(1); }); -export default log \ No newline at end of file +export default log