From e7425fb74724a8ee3965cc0e588bad9aff335487 Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 21 Feb 2020 12:13:59 -0600 Subject: Bad searches should now return a nicer error page --- wqflask/wqflask/search_results.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py index c44436d8..d76add67 100644 --- a/wqflask/wqflask/search_results.py +++ b/wqflask/wqflask/search_results.py @@ -81,7 +81,12 @@ views.py). assert(is_str(kw.get('dataset'))) self.dataset = create_dataset(kw['dataset'], dataset_type) logger.debug("search_terms:", self.search_terms) - self.search() + + #ZS: I don't like using try/except, but it seems like the easiest way to account for all possible bad searches here + try: + self.search() + except: + self.search_term_exists = False if self.search_term_exists: self.gen_search_result() -- cgit v1.2.3