mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
10 lines
362 B
JavaScript
10 lines
362 B
JavaScript
|
var errors = require('../errors');
|
||
|
|
||
|
module.exports.errorHandler = function errorHandler(err, req, res, next) {
|
||
|
/*jshint unused:false */
|
||
|
var httpErrors = errors.formatHttpErrors(err);
|
||
|
errors.logError(err);
|
||
|
// Send a properly formatted HTTP response containing the errors
|
||
|
res.status(httpErrors.statusCode).json({errors: httpErrors.errors});
|
||
|
};
|