aboutsummaryrefslogtreecommitdiff
path: root/qc_app
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-04-10 08:34:01 +0300
committerFrederick Muriuki Muriithi2024-04-10 08:34:01 +0300
commit061a40c14f3adf39c794aa0ddace4835f9282e9b (patch)
tree41c4cf6bd02c616431b1c5eefca58ae338dfd40b /qc_app
parent30e905782b58f4e166c4a166102ea0f7c927dcef (diff)
downloadgn-uploader-061a40c14f3adf39c794aa0ddace4835f9282e9b.tar.gz
Gracefully handle all `werkzeug.exceptions` errors.
Diffstat (limited to 'qc_app')
-rw-r--r--qc_app/errors.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/qc_app/errors.py b/qc_app/errors.py
index d7d3858..ff656b8 100644
--- a/qc_app/errors.py
+++ b/qc_app/errors.py
@@ -1,6 +1,7 @@
"""Application error handling."""
import logging
import traceback
+from werkzeug.exceptions import HTTPException
import MySQLdb as mdb
from flask import Flask, request, render_template, current_app as app
@@ -16,4 +17,5 @@ def handle_general_exception(exc: Exception):
def register_error_handlers(app: Flask):
"""Register top-level error/exception handlers."""
app.register_error_handler(Exception, handle_general_exception)
+ app.register_error_handler(HTTPException, handle_general_exception)
app.register_error_handler(mdb.MySQLError, handle_general_exception)