fix: log more infos for uncaught errors

This commit is contained in:
WebStreamr 2025-09-14 18:12:28 +00:00
parent 8acbd37df3
commit 8b479be6c5
No known key found for this signature in database

View file

@ -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);