FCC-Project_Timestamp-Gener.../scripts/messaging.js
2025-03-19 14:25:45 +00:00

15 lines
No EOL
384 B
JavaScript

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}