Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
yinjiaqi authored and yinjiaqi committed Dec 30, 2024
1 parent 4580ed7 commit 7057817
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions python/core/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,30 +259,21 @@ async def check_response_header(response: ClientResponse):
"""
status_code = response.status
if status_code == requests.codes.ok:
logger.debug("request_id={} , http status code is {} , response text is {}".format(
await __class__.response_request_id(response), status_code, await response.text()
))
return
message = "request_id={} , http status code is {}, body is {}".format(
await __class__.response_request_id(response), status_code, await response.text()
)
if status_code == requests.codes.bad_request:
logger.error(message)
raise BadRequestException(message)
elif status_code == requests.codes.forbidden:
logger.error(message)
raise ForbiddenException(message)
elif status_code == requests.codes.not_found:
logger.error(message)
raise NotFoundException(message)
elif status_code == requests.codes.precondition_required:
logger.error(message)
raise PreconditionFailedException(message)
elif status_code == requests.codes.internal_server_error:
logger.error(message)
raise InternalServerErrorException(message)
else:
logger.error(message)
raise BaseRPCException(message)

@staticmethod
Expand Down

0 comments on commit 7057817

Please sign in to comment.