fix:client mypy error

This commit is contained in:
aries_ckt
2024-03-20 16:22:38 +08:00
parent 7bc5c59a89
commit f43abf3155
19 changed files with 1814 additions and 80 deletions

View File

@@ -24,17 +24,11 @@ class ClientException(Exception):
reason: Optional[str], the reason for the exception.
http_resp: Optional[httpx.Response], the HTTP response object.
"""
reason = json.loads(reason)
if http_resp:
self.status = http_resp.status_code
self.reason = http_resp.content
self.body = http_resp.content
self.headers = None
else:
self.status = status
self.reason = reason
self.body = None
self.headers = None
self.status = status
self.reason = reason
self.http_resp = http_resp
self.headers = http_resp.headers if http_resp else None
self.body = http_resp.text if http_resp else None
def __str__(self):
"""Return the error message."""