forked from Ponysearch/Ponysearch
[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
1 changed files with 3 additions and 0 deletions
|
@ -74,6 +74,9 @@ def load_engine(engine_data):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
engine = load_module(engine_module + '.py', engine_dir)
|
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:
|
except:
|
||||||
logger.exception('Cannot load engine "{}"'.format(engine_module))
|
logger.exception('Cannot load engine "{}"'.format(engine_module))
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in a new issue