mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 02:16:09 -05:00
[Core] Give friendly error when provided instance name doesn't exist. (#2969)
* Update data_manager.py * Towncrier entry
This commit is contained in:
@@ -91,14 +91,20 @@ def load_basic_configuration(instance_name_: str):
|
||||
try:
|
||||
with config_file.open(encoding="utf-8") as fs:
|
||||
config = json.load(fs)
|
||||
except (FileNotFoundError, KeyError):
|
||||
except FileNotFoundError:
|
||||
print(
|
||||
"You need to configure the bot instance using `redbot-setup`"
|
||||
" prior to running the bot."
|
||||
)
|
||||
sys.exit(1)
|
||||
else:
|
||||
try:
|
||||
basic_config = config[instance_name]
|
||||
except KeyError:
|
||||
print(
|
||||
"Instance with this name doesn't exist."
|
||||
" You can create new instance using `redbot-setup` prior to running the bot."
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def _base_data_path() -> Path:
|
||||
|
||||
Reference in New Issue
Block a user