/** * notFound.js * * A custom response. * * Example usage: * ``` * return res.notFound(); * // -or- * return res.notFound(optionalData); * ``` * * Or with actions2: * ``` * exits: { * somethingHappened: { * responseType: 'notFound' * } * } * ``` * * ``` * throw 'somethingHappened'; * // -or- * throw { somethingHappened: optionalData } * ``` */ module.exports = function notFound(message) { const { res } = this; return res.status(404).json({ code: 'E_NOT_FOUND', message, }); };