Skip to content

Conversation

@jsdevel
Copy link

@jsdevel jsdevel commented Jun 22, 2014

Here you go @dougwilson! Let me know if you want anything changed.

This addresses the following issues originally filed in express:
expressjs/express#2194
expressjs/express#2193
expressjs/express#2192

@dougwilson
Copy link
Contributor

Thank you! I will most likely accept this, though not sure when this change can actually make it into express since it will likely break people who are (ab)using errors, haha. 👍

@jsdevel
Copy link
Author

jsdevel commented Jun 22, 2014

That's understandable. In the mean time I think I can do some things on my end to return that status without abusing it ;)

@dougwilson
Copy link
Contributor

If you need it, a work-around to implement this feature in your current express project(s) would be to add this as your first error-handler:

app.use(function(err, req, res, next){
  if (err.status < 400) err.status = undefined
  next()
})

@jsdevel
Copy link
Author

jsdevel commented Jun 22, 2014

Thanks @dougwilson. I was (ab)using next(err) because of the way express-crud was handling empty response bodies. I've since updated it and added a note in the README.

dougwilson added a commit that referenced this pull request Jul 10, 2014
@jsdevel jsdevel deleted the ignoring-err.status-when-less-than-400 branch July 10, 2014 04:22
dougwilson added a commit that referenced this pull request Jul 12, 2014
dougwilson added a commit that referenced this pull request Jul 17, 2014
dougwilson added a commit that referenced this pull request Sep 4, 2014
dougwilson added a commit that referenced this pull request Jul 17, 2015
dougwilson added a commit that referenced this pull request Jul 17, 2015
dougwilson added a commit that referenced this pull request Jul 17, 2015
dougwilson added a commit that referenced this pull request Nov 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants