From 753493121177d92221e199b9f1ca9f35b50f3556 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 6 Apr 2023 13:27:23 +0300 Subject: correlations: Provide more output to enable debug of errors. --- wqflask/wqflask/templates/correlation_error_page.html | 5 +++++ wqflask/wqflask/views.py | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/wqflask/wqflask/templates/correlation_error_page.html b/wqflask/wqflask/templates/correlation_error_page.html index 9197e4a9..7d11daf0 100644 --- a/wqflask/wqflask/templates/correlation_error_page.html +++ b/wqflask/wqflask/templates/correlation_error_page.html @@ -14,5 +14,10 @@

{{error["error-type"]}}

{{error["error-message"]}}

+

+ {%for line in error["stderr-output"]%} + {{line}}
+ {%endfor%} +

{%endblock%} diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index c71ae3c3..69576cc4 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -902,10 +902,14 @@ def corr_compute_page(): if jobs.completed_erroneously(job): try: - ## The "parseable" error report is actually in STDOUT - output = json.loads(job.get("stdout") or "{}") + error_output = { + "error-type": "ComputeError", + "error-message": "There was an error computing the correlations", + **json.loads(job.get("stdout") or "{}"), + "stderr-output": job.get("stderr", "").split("\n") + } return render_template( - "correlation_error_page.html", error=output) + "correlation_error_page.html", error=error_output) except json.decoder.JSONDecodeError as jde: raise Exception(f"STDOUT: {job.get('stdout')}") from jde -- cgit v1.2.3