feat: build
This commit is contained in:
1
music_kraken/utils/exception/__init__.py
Normal file
1
music_kraken/utils/exception/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
__all__ = ["config"]
|
28
music_kraken/utils/exception/config.py
Normal file
28
music_kraken/utils/exception/config.py
Normal file
@@ -0,0 +1,28 @@
|
||||
class SettingException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class SettingNotFound(SettingException):
|
||||
def __init__(self, setting_name: str):
|
||||
self.setting_name = setting_name
|
||||
|
||||
def __str__(self):
|
||||
return f"Setting '{self.setting_name}' not found."
|
||||
|
||||
|
||||
class SettingValueError(SettingException):
|
||||
def __init__(self, setting_name: str, setting_value: str, rule: str):
|
||||
"""
|
||||
The rule has to be such, that the following format makes sense:
|
||||
{name} {rule}, not '{value}'
|
||||
|
||||
:param setting_name:
|
||||
:param setting_value:
|
||||
:param rule:
|
||||
"""
|
||||
self.setting_name = setting_name
|
||||
self.setting_value = setting_value
|
||||
self.rule = rule
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.setting_name} {self.rule}, not '{self.setting_value}'."
|
11
music_kraken/utils/exception/download.py
Normal file
11
music_kraken/utils/exception/download.py
Normal file
@@ -0,0 +1,11 @@
|
||||
class DownloadException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class UrlNotFoundException(DownloadException):
|
||||
def __init__(self, url: str, *args: object) -> None:
|
||||
self.url = url
|
||||
super().__init__(*args)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"Couldn't find the page of {self.url}"
|
10
music_kraken/utils/exception/objects.py
Normal file
10
music_kraken/utils/exception/objects.py
Normal file
@@ -0,0 +1,10 @@
|
||||
class ObjectException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class IsDynamicException(Exception):
|
||||
"""
|
||||
Gets raised, if a dynamic data object tries to perform an action,
|
||||
which does not make sense for a dynamic object.
|
||||
"""
|
||||
pass
|
Reference in New Issue
Block a user