feat: Messaging errors to the user

This commit is contained in:
buzzcode2007 2025-03-19 14:25:45 +00:00
parent 2ec229b1f6
commit fa46a7f1c5

15
scripts/messaging.js Normal file
View 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}