Skip to content

Conversation

@joshfriend
Copy link
Member

Fixes #296 and adds tests.

diezguerra and others added 4 commits September 4, 2014 21:04
The flask-restful library was original designed to handle all errors that
happen within the domain of its restful endpoints.

This design decision collides with the assumption other library writers make,
trusting the custom error handlers they set up in the base app to kick in when
they throw one of their custom exception.

Given that flask-restful hijacks `app.handle_exception` on initialization,
that assumption of the latter developers causes some libraries to fail.

By making the flask-restful error_router fall back onto the `original_handler`
when the local one can't handle / re-raises the exception, we return the
control to the third-party extension handler for a last attempt at handling.

This is probably the case too for the `app.handle_user_exception` hijacking,
but it wasn't investigated this time around.
joshfriend added a commit that referenced this pull request Dec 4, 2014
Make error router fall back to flask error handler
@joshfriend joshfriend merged commit 83eb935 into master Dec 4, 2014
@joshfriend joshfriend deleted the error-router branch December 4, 2014 03:33
@joshfriend joshfriend modified the milestone: 0.3.1 Dec 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants