Skip to content

Commit

Permalink
让错误处理程序兼容被 throw 的字符串
Browse files Browse the repository at this point in the history
  • Loading branch information
jysperm committed Oct 19, 2015
1 parent fe1996d commit c804e00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if (app.get('env') === 'development') {
app.use(function(err, req, res, next) { // jshint ignore:line
res.status(err.status || 500);
res.render('error', {
message: err.message,
message: err.message || err,
error: err
});
});
Expand All @@ -69,7 +69,7 @@ if (app.get('env') === 'development') {
app.use(function(err, req, res, next) { // jshint ignore:line
res.status(err.status || 500);
res.render('error', {
message: err.message,
message: err.message || err,
error: {}
});
});
Expand Down

0 comments on commit c804e00

Please sign in to comment.