diff --git a/scripts/utilities/messaging.JS b/scripts/utilities/messaging.JS new file mode 100644 index 0000000..fdee010 --- /dev/null +++ b/scripts/utilities/messaging.JS @@ -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; \ No newline at end of file