summaryrefslogtreecommitdiff
path: root/searx/search.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2016-12-10 00:15:33 +0100
committerAdam Tauber <asciimoo@gmail.com>2016-12-10 00:15:33 +0100
commit0205838f25116a60490607376477a5ce1c6e6c15 (patch)
tree4ec835b1a30c25d6d9165b8729288e72ba1da570 /searx/search.py
parentceb8ae6439f092dad6e26406cd178c2195eb0898 (diff)
downloadsearxng-0205838f25116a60490607376477a5ce1c6e6c15.tar.gz
searxng-0205838f25116a60490607376477a5ce1c6e6c15.zip
[enh] handle engine response crashes
Diffstat (limited to 'searx/search.py')
-rw-r--r--searx/search.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/searx/search.py b/searx/search.py
index 7dfcd4eeb..e0aa1b58c 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -118,7 +118,11 @@ def search_one_request(engine_name, query, request_params, result_container, tim
if response:
# parse the response
response.search_params = request_params
- search_results = engine.response(response)
+ try:
+ search_results = engine.response(response)
+ except:
+ logger.exception('engine crash: {0}'.format(engine.name))
+ search_results = []
# add results
for result in search_results:
@@ -135,7 +139,6 @@ def search_one_request(engine_name, query, request_params, result_container, tim
engine.stats['engine_time'] += time() - request_params['started']
engine.stats['engine_time_count'] += 1
- #
return success