Commit 83ae5340 authored by André Anjos's avatar André Anjos

Merge branch 'error-handle' into 'master'

Handle errors when loading db interfaces

Closes #24

See merge request !42
parents 7f6b1f36 a66ae2c0
Pipeline #21633 passed with stages
in 19 minutes and 33 seconds
......@@ -174,16 +174,19 @@ def create_parser(**kwargs):
try:
entrypoint.load()
except Exception:
logger.warning("Failed to load `%s' from installed bob.db entrypoints",
logger.error("Failed to load `%s' from installed bob.db entrypoints",
entrypoint.name, exc_info=True)
# at this point we should have loaded all databases
from .driver import Interface
all_modules = []
for plugin in Interface.__subclasses__():
driver = plugin()
driver.add_commands(subparsers)
all_modules.append(driver)
try:
driver = plugin()
driver.add_commands(subparsers)
all_modules.append(driver)
except Exception:
logger.error('Failed to load db interface %s', plugin, exc_info=1)
add_all_commands(parser, subparsers, all_modules) #inserts the master driver
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment