[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.
dependabot/pip/master/sphinx-6.1.3
Alexandre Flament 4 years ago committed by GitHub
parent f77ad22d65
commit 3397382754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save