diff --git a/aiven/client/client.py b/aiven/client/client.py index 26eff86..70f4ca1 100644 --- a/aiven/client/client.py +++ b/aiven/client/client.py @@ -48,7 +48,7 @@ class Error(Exception): """Request error""" def __init__(self, response: Response, status: int = 520) -> None: - Exception.__init__(self, response.text) + Exception.__init__(self, f"{response.text}, status({type(status)})={str(status)}") self.response = response self.status = status diff --git a/tests/test_client.py b/tests/test_client.py index 203af75..c656a12 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -18,12 +18,12 @@ class MockResponse: def __init__( self, - status_code: int, + status_code: int | HTTPStatus, json_data: dict[str, Any] | None = None, headers: dict[str, str] | None = None, content: bytes | None = None, ): - self.status_code = status_code + self.status_code = status_code.value if isinstance(status_code, HTTPStatus) else status_code self.json_data = json_data if content is not None: self.content = content