From db82579172b8eb683877379962833a40a2a3d3d4 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Mon, 15 Sep 2025 05:55:51 -0600 Subject: [PATCH] log brr --- index.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index c188c5f..cd9a87a 100644 --- a/index.js +++ b/index.js @@ -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;