Commit a66ae2c0 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Handle errors when loading db interfaces

parent 7f6b1f36
Pipeline #20733 passed with stage
in 50 minutes and 5 seconds
...@@ -174,16 +174,19 @@ def create_parser(**kwargs): ...@@ -174,16 +174,19 @@ def create_parser(**kwargs):
try: try:
entrypoint.load() entrypoint.load()
except Exception: 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) entrypoint.name, exc_info=True)
# at this point we should have loaded all databases # at this point we should have loaded all databases
from .driver import Interface from .driver import Interface
all_modules = [] all_modules = []
for plugin in Interface.__subclasses__(): for plugin in Interface.__subclasses__():
driver = plugin() try:
driver.add_commands(subparsers) driver = plugin()
all_modules.append(driver) 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 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