Catch all exceptions when loading plugins
This commit is contained in:
parent
6f5e30670f
commit
75605b5f03
@ -75,9 +75,9 @@ def load(configuration, logger):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
class_ = import_module(auth_type).Auth
|
class_ = import_module(auth_type).Auth
|
||||||
except ImportError as e:
|
except Exception as e:
|
||||||
raise RuntimeError("Authentication module %r not found" %
|
raise RuntimeError("Failed to load authentication module %r: %s" %
|
||||||
auth_type) from e
|
(auth_type, e)) from e
|
||||||
logger.info("Authentication type is %r", auth_type)
|
logger.info("Authentication type is %r", auth_type)
|
||||||
return class_(configuration, logger)
|
return class_(configuration, logger)
|
||||||
|
|
||||||
|
@ -63,9 +63,9 @@ def load(configuration, logger):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
rights_class = import_module(rights_type).Rights
|
rights_class = import_module(rights_type).Rights
|
||||||
except ImportError as e:
|
except Exception as e:
|
||||||
raise RuntimeError("Rights module %r not found" %
|
raise RuntimeError("Failed to load rights module %r: %s" %
|
||||||
rights_type) from e
|
(rights_type, e)) from e
|
||||||
logger.info("Rights type is %r", rights_type)
|
logger.info("Rights type is %r", rights_type)
|
||||||
return rights_class(configuration, logger).authorized
|
return rights_class(configuration, logger).authorized
|
||||||
|
|
||||||
|
@ -101,9 +101,9 @@ def load(configuration, logger):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
collection_class = import_module(storage_type).Collection
|
collection_class = import_module(storage_type).Collection
|
||||||
except ImportError as e:
|
except Exception as e:
|
||||||
raise RuntimeError("Storage module %r not found" %
|
raise RuntimeError("Failed to load storage module %r: %s" %
|
||||||
storage_type) from e
|
(storage_type, e)) from e
|
||||||
logger.info("Storage type is %r", storage_type)
|
logger.info("Storage type is %r", storage_type)
|
||||||
|
|
||||||
class CollectionCopy(collection_class):
|
class CollectionCopy(collection_class):
|
||||||
|
@ -55,9 +55,9 @@ def load(configuration, logger):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
web_class = import_module(web_type).Web
|
web_class = import_module(web_type).Web
|
||||||
except ImportError as e:
|
except Exception as e:
|
||||||
raise RuntimeError("Web module %r not found" %
|
raise RuntimeError("Failed to load web module %r: %s" %
|
||||||
web_type) from e
|
(web_type, e)) from e
|
||||||
logger.info("Web type is %r", web_type)
|
logger.info("Web type is %r", web_type)
|
||||||
return web_class(configuration, logger)
|
return web_class(configuration, logger)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user