Created
May 16, 2017 21:48
-
-
Save orels1/d9e11dd23c67a091ef331b319ec2a116 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) => { | |
switch (err.message) { | |
case 'NoCodeProvided': | |
return res.status(400).send({ | |
status: 'ERROR', | |
error: err.message, | |
}); | |
default: | |
return res.status(500).send({ | |
status: 'ERROR', | |
error: err.message, | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment