Created
November 29, 2022 15:09
-
-
Save henno/0c36cd83992e8268d0396a89b4c2446c to your computer and use it in GitHub Desktop.
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
app.use((err, req, res, next) => { | |
const statusCode = err.statusCode || 500; | |
console.error(err.message, err.stack); | |
res.status(statusCode).json({message: err.message }); | |
return; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment