From 5d88fb9acba39c4d78b3bf2753fde1e85482d6f0 Mon Sep 17 00:00:00 2001 From: buzzcode2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Fri, 11 Apr 2025 01:15:17 +0000 Subject: [PATCH] Make error messages more verbose --- scripts/utilities/messaging.JS | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/utilities/messaging.JS b/scripts/utilities/messaging.JS index fdee010..2a0ae41 100644 --- a/scripts/utilities/messaging.JS +++ b/scripts/utilities/messaging.JS @@ -8,9 +8,11 @@ class Messaging { @param {object} ERROR - The error object */ static exception (INSTANCE, ERROR) { - let MESSAGE = {error: ERROR}; - INSTANCE.json(MESSAGE); - console.error(ERROR); + let MESSAGE = {"error": {}}; + [`name`, `message`, `stack`].forEach((KEY) => { + MESSAGE[`error`][KEY] = ERROR[KEY]; + }) + INSTANCE.json(MESSAGE); console.error(ERROR); return (MESSAGE); } }