summaryrefslogtreecommitdiff
path: root/searx/engines/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/engines/__init__.py')
-rw-r--r--searx/engines/__init__.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py
index 70b5ba166..48c02e2e7 100644
--- a/searx/engines/__init__.py
+++ b/searx/engines/__init__.py
@@ -72,8 +72,11 @@ def load_engine(engine_data):
engine_module = engine_data['engine']
- # can raise an exception
- engine = load_module(engine_module + '.py', engine_dir)
+ try:
+ engine = load_module(engine_module + '.py', engine_dir)
+ except:
+ logger.exception('Cannot load engine "{}"'.format(engine_module))
+ return None
for param_name in engine_data:
if param_name == 'engine':
@@ -251,11 +254,9 @@ def load_engines(engine_list):
global engines
engines.clear()
for engine_data in engine_list:
- try:
- engine = load_engine(engine_data)
+ engine = load_engine(engine_data)
+ if engine is not None:
engines[engine.name] = engine
- except:
- logger.exception('Cannot load engine "{}"'.format(engine_data['engine']))
return engines