diff options
author | Frederick Muriuki Muriithi | 2024-04-10 08:34:01 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-04-10 08:34:01 +0300 |
commit | 061a40c14f3adf39c794aa0ddace4835f9282e9b (patch) | |
tree | 41c4cf6bd02c616431b1c5eefca58ae338dfd40b /qc_app/errors.py | |
parent | 30e905782b58f4e166c4a166102ea0f7c927dcef (diff) | |
download | gn-uploader-061a40c14f3adf39c794aa0ddace4835f9282e9b.tar.gz |
Gracefully handle all `werkzeug.exceptions` errors.
Diffstat (limited to 'qc_app/errors.py')
-rw-r--r-- | qc_app/errors.py | 2 |
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) |