Skip to content

Commit

Permalink
Fixed funky error pages not showing up
Browse files Browse the repository at this point in the history
  • Loading branch information
eyeballcode committed Dec 31, 2015
1 parent 4dabd60 commit f8cfabd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ app.use(function (req, res, next) {
if (app.get('env') === 'development') {
app.use(function (err, req, res, next) {
res.status(err.status || 500);
console.log((res.userAgent.indexOf('mobile') === -1 ? 'computer' : 'mobile') + '/error/error' + err.status || 500);
res.render((res.userAgent.indexOf('mobile') === -1 ? 'computer' : 'mobile') + '/error/error' + err.status || 500, {
console.log((res.userAgent.indexOf('mobile') === -1 ? 'computer' : 'mobile') + '/errors/error' + err.status || 500);
res.render((res.userAgent.indexOf('mobile') === -1 ? 'computer' : 'mobile') + '/errors/error' + err.status || 500, {
message: err.message,
error: err
});
Expand All @@ -160,7 +160,7 @@ if (app.get('env') === 'development') {
// no stacktraces leaked to user
app.use(function (err, req, res, next) {
res.status(err.status || 500);
res.render((res.userAgent.indexOf('mobile') === -1 ? 'computer' : 'mobile') + '/error/error' + err.status || 500, {
res.render((res.userAgent.indexOf('mobile') === -1 ? 'computer' : 'mobile') + '/errors/error' + err.status || 500, {
message: err.message,
error: {}
});
Expand Down

0 comments on commit f8cfabd

Please sign in to comment.