summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorNoémi Ványi <sitbackandwait@gmail.com>2020-03-29 13:14:06 +0200
committerNoémi Ványi <sitbackandwait@gmail.com>2020-05-31 19:17:48 +0200
commite3282748d0433d455336487f7e36b789fe6ade30 (patch)
tree521fbd7806bf636bdf09c5e2f9be4d4fa2493e8d /searx
parentd38952c1335d3c6f8615870b11ef9737b203ad49 (diff)
downloadsearxng-e3282748d0433d455336487f7e36b789fe6ade30.tar.gz
searxng-e3282748d0433d455336487f7e36b789fe6ade30.zip
add display_error_messages option to engine settings
A new option is added to engines to hide error messages from users. It is called `display_error_messages` and by default it is set to `True`. If it is set to `False` error messages do not show up on the UI. Keep in mind that engines are still suspended if needed regardless of this setting. Closes #1828
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/__init__.py1
-rw-r--r--searx/results.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py
index 9ccef8b54..48c02e2e7 100644
--- a/searx/engines/__init__.py
+++ b/searx/engines/__init__.py
@@ -55,6 +55,7 @@ engine_default_args = {'paging': False,
'continuous_errors': 0,
'time_range_support': False,
'offline': False,
+ 'display_error_messages': True,
'tokens': []}
diff --git a/searx/results.py b/searx/results.py
index 02ab9efb1..62a01a5bd 100644
--- a/searx/results.py
+++ b/searx/results.py
@@ -346,7 +346,8 @@ class ResultContainer(object):
return resultnum_sum / len(self._number_of_results)
def add_unresponsive_engine(self, engine_name, error_type, error_message=None):
- self.unresponsive_engines.add((engine_name, error_type, error_message))
+ if engines[engine_name].display_error_messages:
+ self.unresponsive_engines.add((engine_name, error_type, error_message))
def add_timing(self, engine_name, engine_time, page_load_time):
self.timings.append({