mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
possible mongo fix (#3319)
* possible mongo fix * prevent swallowing the exception * better log str
This commit is contained in:
@@ -73,7 +73,12 @@ def get_driver_class(storage_type: Optional[BackendType] = None) -> Type[BaseDri
|
||||
|
||||
|
||||
def get_driver(
|
||||
cog_name: str, identifier: str, storage_type: Optional[BackendType] = None, **kwargs
|
||||
cog_name: str,
|
||||
identifier: str,
|
||||
storage_type: Optional[BackendType] = None,
|
||||
*,
|
||||
allow_old: bool = False,
|
||||
**kwargs,
|
||||
):
|
||||
"""Get a driver instance.
|
||||
|
||||
@@ -107,7 +112,10 @@ def get_driver(
|
||||
storage_type = BackendType.JSON
|
||||
|
||||
try:
|
||||
driver_cls: Type[BaseDriver] = get_driver_class(storage_type)
|
||||
if not allow_old:
|
||||
driver_cls: Type[BaseDriver] = get_driver_class(storage_type)
|
||||
else:
|
||||
driver_cls: Type[BaseDriver] = _get_driver_class_include_old(storage_type)
|
||||
except ValueError:
|
||||
if storage_type in (BackendType.MONGOV1, BackendType.MONGO):
|
||||
raise RuntimeError(
|
||||
|
||||
Reference in New Issue
Block a user