1
Fork 0
mirror of https://github.com/RGBCube/GitHubWrapper synced 2025-05-17 22:45:08 +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', 'RepositoryNotFound',
'ObjectNotFound', 'ObjectNotFound',
'NoAuthProvided', 'NoAuthProvided',
'InvalidAuthCombination'
) )
class APIError(Exception): class APIError(Exception):
@ -55,4 +56,9 @@ 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 InvalidAuthCombination(APIError):
def __init__(self):
msg = 'You must provide both a username and a user token or neither.'
super().__init__(msg) super().__init__(msg)