closes #107: Swagger should not override error handling. #131
Conversation
should this move into the develop branch? |
@fehguy this would create a breaking change so I can understand your desire there. How willing are you to bump the major version for this alone? I'd like to use this sooner rather than later. |
@fehguy if we need to make updates to the 2.x.x branch, we could always create a branch for that based on the commit prior to this one. |
As mentioned in #130 I'd update the example to...
And the error handler... function(err,req,res,next) {
res.send(err.status || 500, {error:err})
} oh yeah, and bump at least the minor to the next odd number in the package.json |
Would also suggest considering adding the changes to |
@tracker1 I updated the sample to your liking. This PR really just removes the error handling from |
While I'm not in a place where I can test this, the code change looks solid (on visual inspection). I wonder if addition of a flag to revert back to the old error handling behavior, such that this would no longer be a breaking change, is worthwhile? I have very mixed feelings about this as the code un-cleanliness such a flag would introduce offends me almost to the point where I'm pained to suggest that kind of thing. Another option would be to implement the old-style error handling as a separate module such that existing swagger-node-express users would not be stranded without and upgrade path, but would merely be required to import the separate error handler. |
@hillct I'm with you on the flags. I don't see too much of a difference between express's default error handler and the one swagger provides. The pain point with this breakage is that calls to |
maybe a |
@fehguy I added Can you create a |
hi @jsdevel this is done https://github.com/wordnik/swagger-node-express/tree/2.0.x |
LGTM! |
Thanks @fehguy @timruffles ! I'm looking forward to getting this merged and published so we can start referencing it ;) |
closes #107: Swagger should not override error handling.
Note, this commit produces a 2.1.x version of the swagger module, and has breaking changes with 2.0.x! |
pushed 2.1.0 to npmjs.org |
Awesome @fehguy! Thank you 😄 |
No description provided.