mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
Add some errors for backend conversions and only allow MongoV2 creation (#2570)
* Add some errors for conversions and only allow mongoV2 creation * Add another message * Fixed message to be more clear
This commit is contained in:
@@ -28,8 +28,13 @@ def get_driver(type, *args, **kwargs):
|
||||
from .red_json import JSON
|
||||
|
||||
return JSON(*args, **kwargs)
|
||||
elif type == "MongoDB":
|
||||
elif type == "MongoDBV2":
|
||||
from .red_mongo import Mongo
|
||||
|
||||
return Mongo(*args, **kwargs)
|
||||
elif type == "Mongo":
|
||||
raise RuntimeError(
|
||||
"Please convert to JSON first to continue using the bot."
|
||||
" This is a required conversion prior to using the new Mongo driver."
|
||||
)
|
||||
raise RuntimeError("Invalid driver type: '{}'".format(type))
|
||||
|
||||
Reference in New Issue
Block a user