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:
Will
2019-04-10 20:42:28 -04:00
committed by GitHub
parent 2776db0cf9
commit c82ac5ae68
2 changed files with 14 additions and 5 deletions

View File

@@ -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))