Created
September 7, 2021 20:16
-
-
Save AshleyCoder3/30c0bba279232ff50e2c9947a2aa3ba7 to your computer and use it in GitHub Desktop.
500ErrorMiddleware
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //***********************500 error middleware***********// | |
| //eslint-disable-next-line | |
| server.use((err, req, res, next) => { | |
| res.status(err.status || 500).json({ | |
| message: err.message, | |
| devMessage: 'Something bad inside the server!' | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment