aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_web/routes.py13
-rw-r--r--python/fatcat_web/templates/coverage_search.html7
2 files changed, 19 insertions, 1 deletions
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py
index 9ae2eaa9..4dfbc29c 100644
--- a/python/fatcat_web/routes.py
+++ b/python/fatcat_web/routes.py
@@ -745,7 +745,18 @@ def coverage_search():
)
query = ReleaseQuery.from_args(request.args)
- coverage_stats = get_elastic_search_coverage(query)
+ try:
+ coverage_stats = get_elastic_search_coverage(query)
+ except FatcatSearchError as fse:
+ return render_template(
+ 'coverage_search.html',
+ query=query,
+ coverage_stats=None,
+ coverage_type_preservation=None,
+ year_histogram_svg=None,
+ date_histogram_svg=None,
+ es_error=fse,
+ ), fse.status_code
year_histogram_svg = None
date_histogram_svg = None
coverage_type_preservation = None
diff --git a/python/fatcat_web/templates/coverage_search.html b/python/fatcat_web/templates/coverage_search.html
index 1e0f8327..b1db6a9a 100644
--- a/python/fatcat_web/templates/coverage_search.html
+++ b/python/fatcat_web/templates/coverage_search.html
@@ -1,4 +1,5 @@
{% import "entity_macros.html" as entity_macros %}
+{% import "search_macros.html" as search_macros %}
{% extends "base.html" %}
{% block title %}
@@ -32,6 +33,12 @@
<div class="ui container" style="margin-top: 2em;">
+{% if es_error %}
+ <div class="ui container text">
+ {{ search_macros.es_error_msg(es_error) }}
+ </div>
+{% endif %}
+
{% if coverage_stats != None %}
<div class="ui centered grid">
<div class="row">