mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-22 10:47:58 -05:00
[Core] Specify an error message on package loading (#2207)
Allows cog creators to explain clearly why a cog cannot load by raising `redbot.core.errors.CogLoadError`. Instead of having to check in the console what's wrong, the message will directly be sent in the context channel.
This commit is contained in:
committed by
Toby Harradine
parent
c464f5e7dc
commit
a64db76b4d
@@ -14,3 +14,10 @@ class PackageAlreadyLoaded(RedError):
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"There is already a package named {self.spec.name.split('.')[-1]} loaded"
|
||||
|
||||
|
||||
class CogLoadError(RedError):
|
||||
"""Raised by a cog when it cannot load itself.
|
||||
The message will be send to the user."""
|
||||
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user