Make error messages more verbose

This commit is contained in:
buzzcode2007 2025-04-11 01:15:17 +00:00
parent e526a60bfd
commit 5d88fb9acb

View file

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