From bcdda75a77cc53e7b631af8aab692e5302c5a8c0 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Mon, 13 May 2024 12:29:23 -0600 Subject: [PATCH] Gonna try not killing the bot on rejection/exception, see what happens --- index.js | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/index.js b/index.js index 68d96e1..793ae4d 100644 --- a/index.js +++ b/index.js @@ -1172,23 +1172,7 @@ process.on("unhandledRejection", (error, promise) => { } // write ./error/rejection_timestamp.txt fs.writeFileSync(`./error/rejection_${Date.now()}.txt`, `ERROR:\n${error}\n\nPROMISE:\n${promise}`); - process.exit(1); - if (false) { - fetch(config.ntfy.server, { - method: 'POST', - body: JSON.stringify({ - "topic": config.ntfy.errors, - "message": `Unhandled Rejection: ${error.message}`, - "tags": ["Error"], - "priority": 5 - }), - headers: { - 'Authorization': `Bearer ${config.ntfy.token}` - } - }).catch((err) => { - console.error(err) - }) - } + return; }); process.on("uncaughtException", (error) => { @@ -1199,23 +1183,7 @@ process.on("uncaughtException", (error) => { } // write ./error/exception_timestamp.txt fs.writeFileSync(`./error/exception_${Date.now()}.txt`, error.stack); - process.exit(1); - if (false) { - fetch(config.ntfy.server, { - method: 'POST', - body: JSON.stringify({ - "topic": config.ntfy.errors, - "message": `Uncaught Exception: ${error.message}\n${error.stack}`, - "tags": ["Error"], - "priority": 5 - }), - headers: { - 'Authorization': `Bearer ${config.ntfy.token}` - } - }).catch((err) => { - console.error(err) - }) - } + return; }); // Login to discord