summaryrefslogtreecommitdiff
path: root/discordrpc/exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'discordrpc/exceptions.py')
-rw-r--r--discordrpc/exceptions.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/discordrpc/exceptions.py b/discordrpc/exceptions.py
new file mode 100644
index 0000000..29c3d5c
--- /dev/null
+++ b/discordrpc/exceptions.py
@@ -0,0 +1,29 @@
+class RPCException(Exception):
+ def __init__(self, message: str= None):
+ if message is None:
+ message = 'An error has occurred within DiscordRPC'
+ super().__init__(message)
+
+class Error(RPCException):
+ def __init__(self, message:str):
+ super().__init__(message)
+
+class DiscordNotOpened(RPCException):
+ def __init__(self):
+ super().__init__("Error, could not find Discord. is Discord running?")
+
+class ActivityError(RPCException):
+ def __init__(self):
+ super().__init__("An error has occurred in activity payload, do you have set your activity correctly?")
+
+class InvalidURL(RPCException):
+ def __init__(self):
+ super().__init__("Invalid URL. Must include: http:// or https://")
+
+class InvalidID(RPCException):
+ def __init__(self):
+ super().__init__("Invalid ID, is the ID correct? Get Application ID on https://discord.com/developers/applications")
+
+class ButtonError(RPCException):
+ def __init__(self, message: str = None):
+ super().__init__(message=message)