From 16d8e1f18d5373f0be99f4f620ecef275ab66fe4 Mon Sep 17 00:00:00 2001 From: David Shen Date: Fri, 22 Mar 2024 09:46:22 -0400 Subject: [PATCH] Attempt to query on error condition and print trace --- app/routes.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/routes.py b/app/routes.py index c1f6f36..e51e93a 100644 --- a/app/routes.py +++ b/app/routes.py @@ -8,6 +8,8 @@ import re import urllib.parse as urlparse import uuid import validators +import sys +import traceback from datetime import datetime, timedelta from functools import wraps @@ -622,6 +624,15 @@ def internal_error(e): else: query = request.args.get('q') + # Attempt to parse the query + try: + search_util = Search(request, g.user_config, g.session_key) + query = search_util.new_search_query() + except Exception: + pass + + print(traceback.format_exc(), file=sys.stderr) + localization_lang = g.user_config.get_localization_lang() translation = app.config['TRANSLATIONS'][localization_lang] return render_template(