From 6a5fbf3790ffabf29f7f9ab25364f1f9ddc9eea0 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Sun, 11 Aug 2024 21:59:23 -0600 Subject: [PATCH] Fullstack errors --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 4a29eba..01ba325 100644 --- a/index.js +++ b/index.js @@ -1664,11 +1664,11 @@ dcClient.on('interactionCreate', async interaction => { // Lets actually handle exceptions now process.on('unhandledRejection', (error) => { // Log a full error with line number - sendLog(`${colors.red("[ERROR]")} ${error}`); + sendLog(`${colors.red("[ERROR]")} ${error.stack}`); // If config.ntfyUrl is set, Send the exception to ntfy if (config.ntfyUrl) fetch(config.ntfyUrl, { method: 'POST', // PUT works too - body: error, + body: error.stack, headers: { 'Title': 'FreePBX Bot Rejection', 'Priority': 5, @@ -1679,11 +1679,11 @@ process.on('unhandledRejection', (error) => { process.on('uncaughtException', (error) => { // Log a full error with line number - sendLog(`${colors.red("[ERROR]")} ${error}`); + sendLog(`${colors.red("[ERROR]")} ${error.stack}`); // If config.ntfyUrl is set, Send the exception to ntfy if (config.ntfyUrl) fetch(config.ntfyUrl, { method: 'POST', // PUT works too - body: error, + body: error.stack, headers: { 'Title': 'FreePBX Bot Exception', 'Priority': 5,