From 0aa7d9890b07256c9f3672cc960a111ee5a3394e Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 27 Jun 2024 16:36:44 -0500 Subject: Fix bugs in error-reporting. --- qc_app/errors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qc_app/errors.py b/qc_app/errors.py index bcd3543..3e7c893 100644 --- a/qc_app/errors.py +++ b/qc_app/errors.py @@ -11,13 +11,13 @@ def handle_general_exception(exc: Exception): app.logger.error( "Error (%s.%s): Generic unhandled exception!! (URI: %s)\n%s", exc.__class__.__module__, exc.__class__.__name__, request.url, trace) - return render_template("unhandled_exception.html", trace=trace) + return render_template("unhandled_exception.html", trace=trace), 500 def handle_http_exception(exc: HTTPException): """Handle HTTP exceptions.""" app.logger.error( "HTTP Error %s: %s", exc.code, exc.description, exc_info=True) - return render_template(f"http-error.html", + return render_template("http-error.html", request_url=request.url, exc=exc, trace=traceback.format_exception(exc)), exc.code -- cgit v1.2.3