Plato on Github
Report Home
lib/handlers.js
Maintainability
83.93
Lines of code
6
Difficulty
3.17
Estimated Errors
0.04
Function weight
By Complexity
By SLOC
/** * Log error message and respond with status code 500 * having error message in the response body. * * @param {Object} err: the error object * @param {Object} req: request object * @param {Object} res: response object * @param {Object} next: next callback */ function error(err, req, res, next) { console.error('An unexpected error occurred %s', err.message); res.status(500).send(err.message); } exports.error = error;