mirror of
https://github.com/RGBCube/GitHubWrapper
synced 2025-05-19 15:35:08 +00:00
Fix missing type in exceptions
This commit is contained in:
parent
983a7cb094
commit
f9e2a23dde
1 changed files with 7 additions and 2 deletions
|
@ -1,6 +1,11 @@
|
||||||
#== exceptions.py ==#
|
#== exceptions.py ==#
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from aiohttp import ClientRequest
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
'APIError',
|
'APIError',
|
||||||
'HTTPException',
|
'HTTPException',
|
||||||
|
@ -50,9 +55,9 @@ class Ratelimited(APIError):
|
||||||
|
|
||||||
class WillExceedRatelimit(APIError):
|
class WillExceedRatelimit(APIError):
|
||||||
"""Raised when the library predicts the call will exceed the ratelimit, will abort the call by default."""
|
"""Raised when the library predicts the call will exceed the ratelimit, will abort the call by default."""
|
||||||
def __init__(self, response, count):
|
def __init__(self, response: ClientRequest, count: int):
|
||||||
msg = 'Performing this action will exceed the ratelimit, aborting.\n{} remaining available calls, calls to make: {}.'
|
msg = 'Performing this action will exceed the ratelimit, aborting.\n{} remaining available calls, calls to make: {}.'
|
||||||
msg = msg.format(response.header['X-RateLimit-Remaining'], count)
|
msg = msg.format(response.headers['X-RateLimit-Remaining'], count)
|
||||||
super().__init__(msg)
|
super().__init__(msg)
|
||||||
|
|
||||||
class NoAuthProvided(ClientException):
|
class NoAuthProvided(ClientException):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue