Skip to content
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

Allow exception propagation when app.propagate_exceptions is set #111

Merged
merged 3 commits into from
Aug 9, 2013

Conversation

dtheodor
Copy link
Contributor

@dtheodor dtheodor commented Aug 4, 2013

Added a check in Api.handle_error that propagates exceptions when Flask.propagate_exceptions is set. This honors the app.testing setting as established at http://flask.pocoo.org/docs/api/#flask.Flask.test_client that propagates exceptions instead of returning Flask responses. Otherwise behavior is inconsistent with Flask and testing is harder.

In general it would be nice to use Flask's error handlers instead of hacking a level above them, this would alleviate having to place another check (propagate_exceptions is already checked in flask). I am not sure if the handlers are
good enough to support wrapping all exceptions into json responses though.

dougblack pushed a commit that referenced this pull request Aug 9, 2013
Allow exception propagation when app.propagate_exceptions is set
@dougblack dougblack merged commit ccef20c into flask-restful:master Aug 9, 2013
@dougblack
Copy link
Contributor

Thanks for this.

Flask-RESTful provides it's own error handlers so users that have a Flask-RESTful routes living beside regular Flask routes can handle them based on the type of route.

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.

None yet

2 participants