New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setting status code #4
Comments
What does this have to do with this module? |
if (err.status) res.statusCode = err.status; |
This module only accepts |
Ok, thanks. |
Your best bet if you want to use this module as your handler and throw those objects is to add a pre-processor before this module: app.use(function(err,req,res,next){
if (typeof err.code === 'number') {
// copy Google API code to status property
err.status = err.code;
}
next();
})
app.use(errorHandler()) |
Google APIs are returning error messages in following format:
statusCode is here under code property not status.
The text was updated successfully, but these errors were encountered: