diff options
author | Frederick Muriuki Muriithi | 2022-09-19 07:45:53 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-09-19 07:47:37 +0300 |
commit | 870e1b3f899ba8142ab8c8835d11ac2b2bd203ee (patch) | |
tree | 81185deed5768d026cfbc9a8fbfd0ac700a03d9c | |
parent | 50774454e1424c719b082e8b704296f47a7e0f7d (diff) | |
download | genenetwork2-870e1b3f899ba8142ab8c8835d11ac2b2bd203ee.tar.gz |
Display correct error for missing file/directory
Provide the user with the missing file/directory in the error message
to make debugging easier.
-rw-r--r-- | wqflask/wqflask/templates/mapping_error.html | 39 | ||||
-rw-r--r-- | 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%} <!-- Start of body --> - {{ header("An error occurred during mapping") }} +{{ header("An error occurred during mapping") }} - <div class="container"> - <h3> - <p>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.</p> - </h3> - <br> - <h3> - <p>Try mapping using interval mapping instead; some genotype files with many columns of NAs have issues with GEMMA or R/qtl.</p> - </h3> - </div> +<div class="container"> + <h3> + {%if error:%} + <p> + The following error was raised<br /><br /> + {{error.args[0]}}<br /><br /> + </p> + <p> + Please contact Zach Sloan (zachary.a.sloan@gmail.com) or Arthur Centeno + (acenteno@gmail.com) about the error. + </p> + {%else:%} + <p>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.</p> + </h3> + <br> + <h3> + <p>Try mapping using interval mapping instead; some genotype files with many columns of NAs have issues with GEMMA or R/qtl.</p> + {%endif%} + </h3> +</div> <!-- End of body --> -{% 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: |