diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2020-09-17 19:31:12 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2020-09-17 19:31:12 -0700 |
commit | 4365f7d61b8458c06102e4cb58fd373bbada872a (patch) | |
tree | 4a4840a3e5c7d0cbfe8ff9a0889067f690893344 /python/fatcat_web/routes.py | |
parent | 9cca4e5494235029656757a3dcc066068da190e6 (diff) | |
download | fatcat-4365f7d61b8458c06102e4cb58fd373bbada872a.tar.gz fatcat-4365f7d61b8458c06102e4cb58fd373bbada872a.zip |
coverage search: pretty display for ES query errors
Diffstat (limited to 'python/fatcat_web/routes.py')
-rw-r--r-- | python/fatcat_web/routes.py | 13 |
1 files changed, 12 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 |