From 870e1b3f899ba8142ab8c8835d11ac2b2bd203ee Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 19 Sep 2022 07:45:53 +0300 Subject: Display correct error for missing file/directory Provide the user with the missing file/directory in the error message to make debugging easier. --- wqflask/wqflask/templates/mapping_error.html | 39 ++++++++++++++++++---------- wqflask/wqflask/views.py | 4 +-- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/wqflask/wqflask/templates/mapping_error.html b/wqflask/wqflask/templates/mapping_error.html index 884d4df8..963bf7d6 100644 --- a/wqflask/wqflask/templates/mapping_error.html +++ b/wqflask/wqflask/templates/mapping_error.html @@ -1,20 +1,31 @@ -{% extends "base.html" %} -{% block title %}Error{% endblock %} -{% block content %} +{%extends "base.html"%} +{%block titl%}Error{%endblock%} +{%block content%} - {{ header("An error occurred during mapping") }} +{{ header("An error occurred during mapping") }} -
-

-

There is likely an issue with the genotype file associated with this group/RISet. Please contact Zach Sloan (zachary.a.sloan@gmail.com) or Arthur Centeno (acenteno@gmail.com) about the data set in question.

-

-
-

-

Try mapping using interval mapping instead; some genotype files with many columns of NAs have issues with GEMMA or R/qtl.

-

-
+
+

+ {%if error:%} +

+ The following error was raised

+     {{error.args[0]}}

+

+

+ Please contact Zach Sloan (zachary.a.sloan@gmail.com) or Arthur Centeno + (acenteno@gmail.com) about the error. +

+ {%else:%} +

There is likely an issue with the genotype file associated with this group/RISet. Please contact Zach Sloan (zachary.a.sloan@gmail.com) or Arthur Centeno (acenteno@gmail.com) about the data set in question.

+

+
+

+

Try mapping using interval mapping instead; some genotype files with many columns of NAs have issues with GEMMA or R/qtl.

+ {%endif%} +

+
-{% endblock %} +{%endblock%} diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 223b8507..ee0cd582 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -722,8 +722,8 @@ def mapping_results_page(): if template_vars.no_results: rendered_template = render_template("mapping_error.html") return rendered_template - except: - rendered_template = render_template("mapping_error.html") + except FileNotFoundError as fnfe: + rendered_template = render_template("mapping_error.html", error=fnfe) return rendered_template if not template_vars.pair_scan: -- cgit v1.2.3