From 3a3803ea2deba72257f29ec654917bb271f720f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20P=C3=B6hn?= Date: Wed, 29 Jan 2020 12:39:21 +0100 Subject: [PATCH] raise excepten when starting broken plugin --- fdroidserver/__main__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fdroidserver/__main__.py b/fdroidserver/__main__.py index 70b35993..fa7eb02a 100755 --- a/fdroidserver/__main__.py +++ b/fdroidserver/__main__.py @@ -74,17 +74,19 @@ def find_plugins(): fdroid_modules = [x[1] for x in pkgutil.iter_modules() if x[1].startswith('fdroid_')] commands = {} for module_name in fdroid_modules: + command_name = module_name[7:] try: - command_name = module_name[7:] module = importlib.import_module(module_name) if hasattr(module, 'fdroid_summary') and hasattr(module, 'main'): commands[command_name] = {'summary': module.fdroid_summary, 'module': module} - except IOError: + except Exception as e: # We need to keep module lookup fault tolerant because buggy # modules must not prevent fdroidserver from functioning - # TODO: think about warning users or debug logs for notifying devs - pass + if len(sys.argv) > 1 and sys.argv[1] == command_name: + # only raise exeption when a user specifies the broken + # plugin in explicitly in command line + raise e return commands