Files
cadence-discord-bot/src/events/process/unhandledRejection.ts
T

20 lines
545 B
TypeScript

import { randomUUID as uuidv4 } from 'node:crypto';
import { Logger } from 'pino';
import loggerModule from '../../services/logger';
module.exports = {
name: 'unhandledRejection',
isDebug: false,
execute: async (error: Error) => {
const executionId: string = uuidv4();
const logger: Logger = loggerModule.child({
module: 'event',
name: 'unhandledRejection',
executionId: executionId
});
logger.fatal(error, 'UNHANDLED REJECTION ERROR:');
return;
}
};