Make error messages more verbose
This commit is contained in:
parent
e526a60bfd
commit
5d88fb9acb
1 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue