1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-28 05:26:44 -05:00

Add better error handler

This commit is contained in:
Jack Foltz 2019-01-02 14:20:46 -05:00
parent 3c0e5241b0
commit 82b6288b0e
Signed by: foltik
GPG Key ID: D1F0331758D1F29A

View File

@ -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.'});
}); });