1
Fork 0
mirror of https://github.com/RGBCube/GitHubWrapper synced 2025-05-18 15:05:08 +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',
'RepositoryNotFound',
'ObjectNotFound',
'IssueNotFound',
'NoAuthProvided',
'InvalidAuthCombination',
'InvalidToken',
'AlreadyStarted',
'NotStarted'
)
@ -70,6 +72,11 @@ class InvalidAuthCombination(APIError):
msg = 'You must provide both a username and a user token or neither.'
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):
"""Raised when start is called multiple times."""
def __init__(self):