fix: log more infos for uncaught errors
This commit is contained in:
parent
8acbd37df3
commit
8b479be6c5
1 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue