1
Fork 0
mirror of https://github.com/RGBCube/GitHubWrapper synced 2025-05-17 14:35:09 +00:00

Tidied up exceptions and filled out __all__ for now

This commit is contained in:
sudosnok 2022-03-26 16:40:55 +00:00
parent 47b47b85a1
commit 134b557670

View file

@ -4,7 +4,13 @@ import datetime
__all__ = ( __all__ = (
'APIError', 'APIError',
'Ratelimited' 'Ratelimited',
'WillExceedRatelimit',
'UserNotFound',
'OrganizationNotFound',
'RepositoryNotFound',
'ObjectNotFound',
'NoAuthProvided',
) )
class APIError(Exception): class APIError(Exception):
@ -40,13 +46,13 @@ class RepositoryNotFound(APIError):
msg = 'Repository not found' msg = 'Repository not found'
super().__init__(msg) super().__init__(msg)
class ObjectNotFound(APIError):
def __init__(self):
msg = 'The requested object was not found, ensure spelling is correct before proceeding'
super().__init__(msg)
class NoAuthProvided(APIError): class NoAuthProvided(APIError):
"""Raised when no proper authorization or invalid authorization is given to the client""" """Raised when no proper authorization or invalid authorization is given to the client"""
def __init__(self): def __init__(self):
msg = 'Without authorization, this client doesn\'t have it\'s own repository' msg = 'Without authorization, this client doesn\'t have it\'s own repository'
super().__init__(msg)
class ObjectNotFound(APIError):
def __init__(self):
msg = 'The requested object was not found, ensure spelling is correct before proceeding'
super().__init__(msg) super().__init__(msg)