Added debug log in error handler

no issue

- very helpful when a test is not green
- `DEBUG=ghost:error-handler`
This commit is contained in:
kirrg001 2018-06-14 00:36:19 +02:00
parent 691daa2a49
commit e99fb78b66
1 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,6 @@
var _ = require('lodash'),
hbs = require('express-hbs'),
debug = require('ghost-ignition').debug('error-handler'),
config = require('../../config'),
common = require('../../lib/common'),
helpers = require('../../services/routing/helpers'),
@ -24,6 +25,8 @@ _private.createHbsEngine = function createHbsEngine() {
* @TODO: support multiple errors within one single error, see https://github.com/TryGhost/Ghost/issues/7116#issuecomment-252231809
*/
_private.prepareError = function prepareError(err, req, res, next) {
debug(err);
if (_.isArray(err)) {
err = err[0];
}