Last active
September 8, 2021 21:15
-
-
Save tdubs42/c852b7dbbc0b09b77d436f7665559826 to your computer and use it in GitHub Desktop.
use in express server to feed errors down the pipeline via .catch(next) || next({status: CODE, message: MESSAGE})
This file contains 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
/* eslint-disable */ | |
router.use((err, req, res, next) => { | |
res.status(err.status || 500).json({ | |
fromTheDev: 'mistakes were made', | |
message: err.message, | |
stack: err.stack, | |
}) | |
}) | |
/* eslint-enable */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment