-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.py
37 lines (29 loc) · 958 Bytes
/
errors.py
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
30
31
32
33
34
35
36
37
__all__ = (
"ConfigException",
"ConfigNotFound",
"UnknownConfigFormat",
"UnknownEmbedType",
)
class ConfigException(Exception):
def __init__(self, _type: str, message: str):
self.msg = f"{_type}: {message}"
self.type = _type
super().__init__(self.msg)
class ConfigNotFound(ConfigException):
def __init__(self):
super().__init__(
_type="ConfigNotFound",
message="A configuration file was not found. Please create a 'config.json' file",
)
class UnknownConfigFormat(ConfigException):
def __init__(self):
super().__init__(
_type="UnknownConfigFormat",
message="Your configuration file's format is unknown.",
)
class UnknownEmbedType(ConfigException):
def __init__(self, _type):
super().__init__(
_type="UnknownEmbedType", message=f"Unknown Embed Type '{_type}'"
)
self.type = _type