summaryrefslogtreecommitdiff
path: root/discordrpc/exceptions.py
blob: 29c3d5cfd0ac3ed0577dbfa531757911aba2aa5c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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)