diff options
author | Alexander_Kabui | 2024-05-09 16:01:21 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-05-09 16:10:44 +0300 |
commit | eef53a8d772c6297e6ff097808e5fd36eb94e432 (patch) | |
tree | 95bf69e34d6cc56f4ce037d19d6663239c707ba7 /gn2/wqflask | |
parent | 35eb765a26b1fabe27038d8dc9a8721dab182325 (diff) | |
download | genenetwork2-eef53a8d772c6297e6ff097808e5fd36eb94e432.tar.gz |
Improve error messaging for errors in gn fahamu UI.
Diffstat (limited to 'gn2/wqflask')
-rw-r--r-- | gn2/wqflask/views.py | 8 |
1 files 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( |