aboutsummaryrefslogtreecommitdiff
path: root/discord/errors.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-10-27 18:09:26 -0400
committerRapptz <[email protected]>2015-10-27 18:09:26 -0400
commit61e41ec3b9ce2eed3fc3494910f4269b42df9b14 (patch)
treec4cce25fd1d16b750a14db58edf9348c2a8f973a /discord/errors.py
parentRemove InvalidEventName exception due to it being unused (diff)
downloaddiscord.py-61e41ec3b9ce2eed3fc3494910f4269b42df9b14.tar.xz
discord.py-61e41ec3b9ce2eed3fc3494910f4269b42df9b14.zip
All exceptions now derive from DiscordException.
Diffstat (limited to 'discord/errors.py')
-rw-r--r--discord/errors.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/discord/errors.py b/discord/errors.py
index 36ec3b48..e50e0386 100644
--- a/discord/errors.py
+++ b/discord/errors.py
@@ -24,10 +24,16 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""
-class InvalidDestination(Exception):
+class DiscordException(Exception):
+ """Base exception class for discord.py
+
+ Ideally speaking, this could be caught to handle any exceptions thrown from this library.
+ """
+
+class InvalidDestination(DiscordException):
"""Thrown when the destination from :meth:`Client.send_message` is invalid."""
pass
-class GatewayNotFound(Exception):
+class GatewayNotFound(DiscordException):
"""Thrown when the gateway hub for the :class:`Client` websocket is not found."""
pass