Skip to content

Commit

Permalink
Merge pull request #402 from thomsentner/feature/401_correcly_log_sta…
Browse files Browse the repository at this point in the history
…tus_codes

Correctly log werkzeug.exceptions.HTTPExceptions
  • Loading branch information
FlyingBird95 authored Jan 1, 2022
2 parents ae3b49d + 43fce79 commit 0bb90e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flask_monitoringdashboard/core/measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ def evaluate(route_handler, args, kwargs):
return result, status_code, None

except Exception as e:
return None, 500, e
try:
status_code = e.code
except AttributeError:
status_code = 500
return None, status_code, e


def add_wrapper1(endpoint, fun):
Expand Down

0 comments on commit 0bb90e0

Please sign in to comment.