Add error messaging

This commit is contained in:
buzzcode2007 2025-03-20 02:00:51 +00:00
parent 3cd55961cb
commit 1d2e0726da

16
scripts/messaging.js Normal file
View file

@ -0,0 +1,16 @@
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}