mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 14:38:49 +00:00
20 lines
545 B
TypeScript
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;
|
|
}
|
|
};
|