Add messaging module

This commit is contained in:
buzz-lightsnack-2007 2025-04-07 22:24:09 +08:00
parent 0458e11267
commit 49af0811f1

View file

@ -0,0 +1,18 @@
const CustomErrors = require(`./errors.JS`);
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};
INSTANCE.json(MESSAGE);
console.error(ERROR);
return (MESSAGE);
}
}
module.exports = Messaging;