FCC-Project-HeaderParser/scripts/messaging.js
2025-03-20 02:00:51 +00:00

16 lines
No EOL
407 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: {'name': ERROR.name, 'message': ERROR.message}};
INSTANCE.json(MESSAGE);
console.error(ERROR);
return (MESSAGE);
}
}
module.exports = {Messaging}