This commit is contained in:
Christopher Cookman 2025-09-15 05:55:51 -06:00
parent d3b273010e
commit db82579172

View file

@ -125,17 +125,20 @@ client.on("messageCreate", async (message) => {
global.dmHandlers[message.author.id](message);
});
// Global error handling for unhandled promise rejections and uncaught exceptions
process.on('unhandledRejection', (reason, promise) => {
log.error(`Unhandled Rejection: ${reason}`);
// Application specific logging, throwing an error, or other logic here
});
if (process.env.NODE_ENV !== 'production') {
process.on('uncaughtException', (error) => {
log.error('Uncaught Exception thrown:', error);
// Application specific logging, throwing an error, or other logic here
});
// Global error handling for unhandled promise rejections and uncaught exceptions
process.on('unhandledRejection', (reason, promise) => {
log.error(`Unhandled Rejection: ${reason}`);
// Application specific logging, throwing an error, or other logic here
});
process.on('uncaughtException', (error) => {
log.error('Uncaught Exception thrown:', error);
// Application specific logging, throwing an error, or other logic here
});
}
const port = process.env.SERVER_PORT || 3000;