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); } }