From bd30bac100db45732e37e785cee816ccbba3c93d Mon Sep 17 00:00:00 2001 From: Hanne Moa Date: Fri, 19 Jan 2024 10:15:02 +0100 Subject: [PATCH] Fix lookup of session key in error handler --- src/howitz/error_handlers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/howitz/error_handlers.py b/src/howitz/error_handlers.py index 567e6ad8..6acaaf9f 100644 --- a/src/howitz/error_handlers.py +++ b/src/howitz/error_handlers.py @@ -32,6 +32,8 @@ def handle_generic_exception(e): alert_random_id = str(uuid.uuid4()) short_err_msg = 'An unexpected error has occurred' + if not "errors" in session: + session["errors"] = dict() session["errors"][str(alert_random_id)] = serialize_exception(e) session.modified = True current_app.logger.debug('ERRORS %s', session["errors"])