2020-07-10 14:11:45 +00:00
|
|
|
class WikiError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
class WikiServerError(Exception):
|
2022-08-09 14:08:30 +00:00
|
|
|
def __init__(self, exception: BaseException):
|
|
|
|
self.exception = exception
|
|
|
|
|
2020-07-10 14:11:45 +00:00
|
|
|
|
|
|
|
class WikiNotFoundError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
class WikiRemovedError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
class WikiUnauthorizedError(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
class OtherWikiError(Exception):
|
2020-08-05 14:41:40 +00:00
|
|
|
pass
|
|
|
|
|
|
|
|
class QueueEmpty(Exception):
|
|
|
|
pass
|
|
|
|
|
|
|
|
class ListFull(Exception):
|
2020-11-21 22:33:57 +00:00
|
|
|
pass
|
|
|
|
|
|
|
|
class EmbedListFull(Exception):
|
2021-06-05 11:12:23 +00:00
|
|
|
pass
|
|
|
|
|
2021-07-18 12:40:26 +00:00
|
|
|
class TagNotFound(Exception):
|
|
|
|
pass
|
|
|
|
|
2021-06-05 11:12:23 +00:00
|
|
|
class ServerError(Exception):
|
|
|
|
"""Exception for when a request fails because of Server error"""
|
|
|
|
pass
|
|
|
|
|
2022-10-03 13:34:36 +00:00
|
|
|
class FormatterBreaksAPISpec(Exception):
|
|
|
|
def __init__(self, field):
|
|
|
|
self.message = f"Formatter doesn't specify {field}!"
|
|
|
|
super().__init__(self.message)
|
|
|
|
|
2021-06-05 11:12:23 +00:00
|
|
|
|
|
|
|
class ClientError(Exception):
|
|
|
|
"""Exception for when a request failes because of Client error"""
|
|
|
|
|
|
|
|
def __init__(self, request):
|
|
|
|
self.message = f"Client have made wrong request! {request.status_code}: {request.reason}. {request.text}"
|
|
|
|
super().__init__(self.message)
|
|
|
|
|
|
|
|
|
|
|
|
class BadRequest(Exception):
|
|
|
|
"""When type of parameter given to request making method is invalid"""
|
|
|
|
def __init__(self, object_type):
|
|
|
|
self.message = f"params must be either a strong or OrderedDict object, not {type(object_type)}!"
|
|
|
|
super().__init__(self.message)
|
|
|
|
|
|
|
|
|
|
|
|
class MediaWikiError(Exception):
|
|
|
|
"""When MediaWiki responds with an error"""
|
|
|
|
def __init__(self, errors):
|
|
|
|
self.message = f"MediaWiki returned the following errors: {errors}!"
|
|
|
|
super().__init__(self.message)
|
|
|
|
|
2022-07-26 13:48:44 +00:00
|
|
|
class NoDomain(Exception):
|
|
|
|
"""When given domain does not exist"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
class WikiExists(Exception):
|
|
|
|
"""When given wiki already exists"""
|
2022-08-31 12:30:41 +00:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class ExhaustedDiscordBucket(BaseException):
|
|
|
|
def __init__(self, remaining: int, is_global: bool):
|
|
|
|
self.remaining = remaining
|
|
|
|
self.is_global = is_global
|