Skip to content

Commit

Permalink
Properly set http status code for "regular" flask errors (like 405 me…
Browse files Browse the repository at this point in the history
…thod not allowed), instead of setting them all to 500.
  • Loading branch information
cyberw committed Apr 21, 2024
1 parent ca33b58 commit 172c4f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion locust/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def __init__(
def handle_exception(error):
error_message = str(error)
logger.log(logging.CRITICAL, error_message)
return make_response(error_message, 500)
return make_response(error_message, getattr(error, "code", 500))

@app.route("/assets/<path:path>")
def send_assets(path):
Expand Down

0 comments on commit 172c4f5

Please sign in to comment.