From 8b479be6c5e2530e445d9b9c71d02078a5600feb Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Sun, 14 Sep 2025 18:12:28 +0000 Subject: [PATCH] fix: log more infos for uncaught errors --- src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 85b85b0..0f60826 100644 --- a/src/index.ts +++ b/src/index.ts @@ -26,12 +26,12 @@ const logger = winston.createLogger({ ], }); -process.on('uncaughtException', (error) => { - logger.error('Uncaught exception caught:', error); +process.on('uncaughtException', (error: Error) => { + logger.error(`Uncaught exception caught: ${error}, cause: ${error.cause}, stack: ${error.stack}`); }); -process.on('unhandledRejection', (reason) => { - logger.error('Unhandled rejection: ', reason); +process.on('unhandledRejection', (error: Error) => { + logger.error(`Unhandled rejection: ${error}, cause: ${error.cause}, stack: ${error.stack}`); }); const fetcher = new Fetcher(logger);