mirror of
https://github.com/searxng/searxng.git
synced 2024-11-22 12:10:11 +01:00
[enh] stop searx when an engine raise an SyntaxError exception (#2177)
and some other exceptions: * KeyboardInterrupt * SystemExit * RuntimeError * SystemError * ImportError: an engine with an unmet dependency will stop everything.
This commit is contained in:
parent
f77ad22d65
commit
3397382754
@ -74,6 +74,9 @@ def load_engine(engine_data):
|
||||
|
||||
try:
|
||||
engine = load_module(engine_module + '.py', engine_dir)
|
||||
except (SyntaxError, KeyboardInterrupt, SystemExit, SystemError, ImportError, RuntimeError) as e:
|
||||
logger.exception('Fatal exception in engine "{}"'.format(engine_module))
|
||||
sys.exit(1)
|
||||
except:
|
||||
logger.exception('Cannot load engine "{}"'.format(engine_module))
|
||||
return None
|
||||
|
Loading…
Reference in New Issue
Block a user