mirror of
https://github.com/RGBCube/GitHubWrapper
synced 2025-05-18 15:05:08 +00:00
Added a couple more exceptions
This commit is contained in:
parent
eb7e07f74d
commit
e4aedcce97
1 changed files with 15 additions and 1 deletions
|
@ -11,7 +11,9 @@ __all__ = (
|
|||
'RepositoryNotFound',
|
||||
'ObjectNotFound',
|
||||
'NoAuthProvided',
|
||||
'InvalidAuthCombination'
|
||||
'InvalidAuthCombination',
|
||||
'AlreadyStarted',
|
||||
'NotStarted'
|
||||
)
|
||||
|
||||
class APIError(Exception):
|
||||
|
@ -61,4 +63,16 @@ class NoAuthProvided(APIError):
|
|||
class InvalidAuthCombination(APIError):
|
||||
def __init__(self):
|
||||
msg = 'You must provide both a username and a user token or neither.'
|
||||
super().__init__(msg)
|
||||
|
||||
class AlreadyStarted(APIError):
|
||||
"""Raised when start is called multiple times."""
|
||||
def __init__(self):
|
||||
msg = 'This client has already been started and cannot be started again.'
|
||||
super().__init__(msg)
|
||||
|
||||
class NotStarted(APIError):
|
||||
"""Raised when a call is made before start is called."""
|
||||
def __init__(self):
|
||||
msg = 'You must call `await <Github_instance>.start()` before making this call.'
|
||||
super().__init__(msg)
|
Loading…
Add table
Add a link
Reference in a new issue