Skip to content

Commit

Permalink
Merge pull request #4384 from meowtec/fix-error-log
Browse files Browse the repository at this point in the history
fix bug in which `logError` could not resolve an err without `message`
  • Loading branch information
jaswilli committed Nov 5, 2014
2 parents 42270a9 + d42703d commit d5f13e1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/server/errors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ errors = {

stack = err ? err.stack : null;

err = _.isString(err) ? err : (_.isObject(err) ? err.message : 'An unknown error occurred.');
if (!_.isString(err)) {
if (_.isObject(err) && _.isString(err.message)) {
err = err.message;
} else {
err = 'An unknown error occurred.';
}
}

// Overwrite error to provide information that this is probably a permission problem
// TODO: https://github.com/TryGhost/Ghost/issues/3687
Expand Down

0 comments on commit d5f13e1

Please sign in to comment.