mirror of
https://github.com/RGBCube/GitHubWrapper
synced 2025-05-17 14:35:09 +00:00
Added exception
This commit is contained in:
parent
01050b4700
commit
25710629f2
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
Loading…
Add table
Add a link
Reference in a new issue