mirror of
https://github.com/Foltik/Shimapan
synced 2024-11-30 14:31:42 -05:00
Add better error handler
This commit is contained in:
parent
3c0e5241b0
commit
82b6288b0e
@ -76,6 +76,8 @@ require('./config/passport.js');
|
|||||||
|
|
||||||
// Error handler
|
// Error handler
|
||||||
app.use((err, req, res, next) => {
|
app.use((err, req, res, next) => {
|
||||||
|
console.error('Unhandled error!');
|
||||||
|
console.error(err);
|
||||||
console.error(err.stack);
|
console.error(err.stack);
|
||||||
res.status(500).json({'message': 'Internal server error.'});
|
res.status(500).json({'message': 'Internal server error.'});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user