#62 Fixed development 500s

master
Keith Irwin 2017-04-20 22:15:00 -04:00
parent c5f9d32d59
commit 6dfcf09ab2
No known key found for this signature in database
GPG Key ID: 378933C743E2BBC0
2 changed files with 6 additions and 4 deletions

View File

@ -45,8 +45,7 @@ router
})
.post('/settings', (req,res)=>{
//TODO: Test validation here.
//TODO: Test validation here?
});

View File

@ -117,6 +117,10 @@ const
app.use( '/test', require('./config/routes/test.js' ) );
}
app.get('/500', (req,res)=>{
Balls
});
}
/* Errors */ {
@ -136,7 +140,6 @@ const
if (err.status!==404){ console.error(err.stack); }
if (res.headersSent) { return next(err); }
res.status(err.status||500);
console.log(err.status===500)?"Server error":err.message;
res.render('error', {
code: err.status,
message: (err.status===500)?"Server error":err.message
@ -149,7 +152,7 @@ const
if (res.headersSent) { return next(err); }
res.status(err.status||500);
res.render('error', {
code: err.status,
code: err.status||500,
message: err.message,
stack: err.stack
});