Skip to content

Commit

Permalink
Add type annotation for HTTPError
Browse files Browse the repository at this point in the history
  • Loading branch information
wenleix committed Jun 1, 2024
1 parent b6d8e56 commit 2698370
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion aiogoogle/excs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
from __future__ import annotations
from typing import TYPE_CHECKING

__all__ = ["AiogoogleError", "ValidationError", "HTTPError", "AuthError"]

if TYPE_CHECKING:
from .models import Response


class AiogoogleError(Exception):
pass
Expand All @@ -14,7 +20,7 @@ class ValidationError(AiogoogleError):


class HTTPError(AiogoogleError):
def __init__(self, msg, req=None, res=None):
def __init__(self, msg, req, res: Response):
self.req = req
self.res = res
super().__init__(msg)
Expand Down
2 changes: 1 addition & 1 deletion aiogoogle/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class Response:

def __init__(
self,
status_code=None,
status_code: int,
headers=None,
url=None,
json=None,
Expand Down

0 comments on commit 2698370

Please sign in to comment.