From eef53a8d772c6297e6ff097808e5fd36eb94e432 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Thu, 9 May 2024 16:01:21 +0300 Subject: Improve error messaging for errors in gn fahamu UI. --- gn2/wqflask/views.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py index eb741701..c35bc88f 100644 --- a/gn2/wqflask/views.py +++ b/gn2/wqflask/views.py @@ -264,8 +264,10 @@ def gnqna(): def __error__(resp): return resp.json() - def error_page(error_msg): - return render_template("gnqa_errors.html", error=error_msg) + def error_page(resp): + breakpoint() + return render_template("gnqa_errors.html", + **{"status_code": resp.status_code, **resp.json()}) def __success__(resp): return render_template("gnqa_answer.html", **{"gn_server_url": GN3_LOCAL_URL, **(resp.json())}) @@ -286,7 +288,7 @@ def gnqna(): ).then( lambda resp: resp ).either( - __error__, __success__) + error_page, __success__) except Exception as error: return flask.jsonify({"error": str(error)}) prev_queries = (monad_requests.get( -- cgit v1.2.3