feat: Messaging errors to the user
This commit is contained in:
parent
2ec229b1f6
commit
fa46a7f1c5
1 changed files with 15 additions and 0 deletions
15
scripts/messaging.js
Normal file
15
scripts/messaging.js
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
class Messaging {
|
||||||
|
/*
|
||||||
|
Return an error message.
|
||||||
|
|
||||||
|
@param {object} INSTANCE - The response instance
|
||||||
|
@param {object} ERROR - The error object
|
||||||
|
*/
|
||||||
|
static exception (INSTANCE, ERROR) {
|
||||||
|
let MESSAGE = {error: (ERROR.name.includes(`Eval`)) ? `Invalid Date` : ERROR}
|
||||||
|
INSTANCE.json(MESSAGE);
|
||||||
|
return (MESSAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {Messaging}
|
Loading…
Add table
Add a link
Reference in a new issue