added proper http codes
This commit is contained in:
@@ -158,7 +158,7 @@ def ratelimit_handler(e):
|
||||
msg = Message('429 Ratelimit hit', recipients=["simon.bussmann@tum.de"])
|
||||
msg.body = f"IP {request.remote_addr} triggered the rate limit"
|
||||
mail.send(msg)
|
||||
return render_template("ratelimit_error.html", error_message=e.description)
|
||||
return render_template("ratelimit_error.html", error_message=e.description), 429
|
||||
|
||||
@bp.errorhandler(500)
|
||||
def server_error(e):
|
||||
@@ -168,4 +168,4 @@ def server_error(e):
|
||||
msg.body = f"An error occurred during registration:\n\n{full_traceback}"
|
||||
mail.send(msg)
|
||||
|
||||
return render_template("error.html", error_message="Internal Server Error. Admin has been notified!")
|
||||
return render_template("error.html", error_message="Internal Server Error. Admin has been notified!"), 500
|
||||
|
||||
Reference in New Issue
Block a user