Skip to content
This repository has been archived by the owner. It is now read-only.

Avoid swallowing flask control-flow exceptions #158

Merged
merged 2 commits into from Mar 18, 2019
Merged

Avoid swallowing flask control-flow exceptions #158

merged 2 commits into from Mar 18, 2019

Conversation

@c-w
Copy link
Contributor

@c-w c-w commented Mar 18, 2019

The Flask 1.0 release changed the semantics of @app.errorhandler(Exception).

Previously, this feature would catch application internal exceptions only. Since the Flask 1.0 release, this now catches all exceptions, including werkzeug's HTTPException which is used internally by Flask for control flow, e.g. 404 not found, 403 forbidden, etc. The side-effect of this change is that the AppInsights exception handler now translated these control flow exceptions into uncaught exceptions, i.e. HTTP 500 errors.

This change makes the AppInsights exception handler more robust to no longer swallow the control-flow exceptions.

Resolves #124

c-w and others added 2 commits Mar 18, 2019
The Flask 1.0 release changed the semantics of
`@app.errorhandler(Exception)`.

Previously, this feature would catch application internal exceptions
only. Since the Flask 1.0 release, this now catches all exceptions,
including werkzeug's HTTPException which is used internally by Flask for
control flow, e.g. 404 not found, 403 forbidden, etc. The side-effect of
this change is that the AppInsights exception handler now translated
these control flow exceptions into uncaught exceptions, i.e. HTTP 500
errors.
@SergeyKanzhelev SergeyKanzhelev merged commit 037dbed into microsoft:develop Mar 18, 2019
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants