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

Added exception

This commit is contained in:
sudosnok 2022-03-26 21:37:50 +00:00
parent 01050b4700
commit 25710629f2

View file

@ -11,6 +11,7 @@ __all__ = (
'RepositoryNotFound',
'ObjectNotFound',
'NoAuthProvided',
'InvalidAuthCombination'
)
class APIError(Exception):
@ -55,4 +56,9 @@ class NoAuthProvided(APIError):
"""Raised when no proper authorization or invalid authorization is given to the client"""
def __init__(self):
msg = 'Without authorization, this client doesn\'t have it\'s own repository'
super().__init__(msg)
class InvalidAuthCombination(APIError):
def __init__(self):
msg = 'You must provide both a username and a user token or neither.'
super().__init__(msg)