Skip to content

Commit 7c4b493

Browse files
authored
Move Extension Errors to discord.errors
1 parent 8824d66 commit 7c4b493

File tree

1 file changed

+0
-82
lines changed

1 file changed

+0
-82
lines changed

discord/ext/commands/errors.py

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,6 @@
8686
'UnexpectedQuoteError',
8787
'InvalidEndOfQuotedStringError',
8888
'ExpectedClosingQuoteError',
89-
'ExtensionError',
90-
'ExtensionAlreadyLoaded',
91-
'ExtensionNotLoaded',
92-
'NoEntryPointError',
93-
'ExtensionFailed',
94-
'ExtensionNotFound',
9589
'CommandRegistrationError',
9690
'FlagError',
9791
'BadFlagArgument',
@@ -818,82 +812,6 @@ def __init__(self, close_quote: str) -> None:
818812
self.close_quote: str = close_quote
819813
super().__init__(f'Expected closing {close_quote}.')
820814

821-
class ExtensionError(DiscordException):
822-
"""Base exception for extension related errors.
823-
824-
This inherits from :exc:`~discord.DiscordException`.
825-
826-
Attributes
827-
------------
828-
name: :class:`str`
829-
The extension that had an error.
830-
"""
831-
def __init__(self, message: Optional[str] = None, *args: Any, name: str) -> None:
832-
self.name: str = name
833-
message = message or f'Extension {name!r} had an error.'
834-
# clean-up @everyone and @here mentions
835-
m = message.replace('@everyone', '@\u200beveryone').replace('@here', '@\u200bhere')
836-
super().__init__(m, *args)
837-
838-
class ExtensionAlreadyLoaded(ExtensionError):
839-
"""An exception raised when an extension has already been loaded.
840-
841-
This inherits from :exc:`ExtensionError`
842-
"""
843-
def __init__(self, name: str) -> None:
844-
super().__init__(f'Extension {name!r} is already loaded.', name=name)
845-
846-
class ExtensionNotLoaded(ExtensionError):
847-
"""An exception raised when an extension was not loaded.
848-
849-
This inherits from :exc:`ExtensionError`
850-
"""
851-
def __init__(self, name: str) -> None:
852-
super().__init__(f'Extension {name!r} has not been loaded.', name=name)
853-
854-
class NoEntryPointError(ExtensionError):
855-
"""An exception raised when an extension does not have a ``setup`` entry point function.
856-
857-
This inherits from :exc:`ExtensionError`
858-
"""
859-
def __init__(self, name: str) -> None:
860-
super().__init__(f"Extension {name!r} has no 'setup' function.", name=name)
861-
862-
class ExtensionFailed(ExtensionError):
863-
"""An exception raised when an extension failed to load during execution of the module or ``setup`` entry point.
864-
865-
This inherits from :exc:`ExtensionError`
866-
867-
Attributes
868-
-----------
869-
name: :class:`str`
870-
The extension that had the error.
871-
original: :exc:`Exception`
872-
The original exception that was raised. You can also get this via
873-
the ``__cause__`` attribute.
874-
"""
875-
def __init__(self, name: str, original: Exception) -> None:
876-
self.original: Exception = original
877-
msg = f'Extension {name!r} raised an error: {original.__class__.__name__}: {original}'
878-
super().__init__(msg, name=name)
879-
880-
class ExtensionNotFound(ExtensionError):
881-
"""An exception raised when an extension is not found.
882-
883-
This inherits from :exc:`ExtensionError`
884-
885-
.. versionchanged:: 1.3
886-
Made the ``original`` attribute always None.
887-
888-
Attributes
889-
-----------
890-
name: :class:`str`
891-
The extension that had the error.
892-
"""
893-
def __init__(self, name: str) -> None:
894-
msg = f'Extension {name!r} could not be loaded.'
895-
super().__init__(msg, name=name)
896-
897815
class CommandRegistrationError(ClientException):
898816
"""An exception raised when the command can't be added
899817
because the name is already taken by a different command.

0 commit comments

Comments
 (0)