1
Fork 0
mirror of https://github.com/RGBCube/GitHubWrapper synced 2025-07-08 15:17:35 +00:00

Added exception for invalid tokens

This commit is contained in:
sudosnok 2022-04-02 18:48:32 +01:00
parent ddb00602ab
commit 963029808b

View file

@ -10,8 +10,10 @@ __all__ = (
'OrganizationNotFound', 'OrganizationNotFound',
'RepositoryNotFound', 'RepositoryNotFound',
'ObjectNotFound', 'ObjectNotFound',
'IssueNotFound',
'NoAuthProvided', 'NoAuthProvided',
'InvalidAuthCombination', 'InvalidAuthCombination',
'InvalidToken',
'AlreadyStarted', 'AlreadyStarted',
'NotStarted' 'NotStarted'
) )
@ -70,6 +72,11 @@ class InvalidAuthCombination(APIError):
msg = 'You must provide both a username and a user token or neither.' msg = 'You must provide both a username and a user token or neither.'
super().__init__(msg) super().__init__(msg)
class InvalidToken(APIError):
def __init__(self) -> None:
msg = "The token you provided was invalid, please check again."
super().__init__(msg)
class AlreadyStarted(APIError): class AlreadyStarted(APIError):
"""Raised when start is called multiple times.""" """Raised when start is called multiple times."""
def __init__(self): def __init__(self):