Skip to content

Commit 0d95bca

Browse files
author
Ori Shoshan
committed
Propagate exceptions from the flask-restplus handler, even if they come from a restplus resource (for example, if you decorate a restplus resource with Flask-JWT's @jwt_required, then restplus will catch it even if it shouldn't)
1 parent 874fda1 commit 0d95bca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

flask_restplus/api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,13 @@ def handle_error(self, e):
592592
'''
593593
got_request_exception.send(current_app._get_current_object(), exception=e)
594594

595+
if not isinstance(e, HTTPException) and current_app.propagate_exceptions:
596+
exc_type, exc_value, tb = sys.exc_info()
597+
if exc_value is e:
598+
raise
599+
else:
600+
raise e
601+
595602
include_message_in_response = current_app.config.get("ERROR_INCLUDE_MESSAGE", True)
596603
default_data = {}
597604

0 commit comments

Comments
 (0)