Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
w5688414 committed Feb 26, 2024
1 parent 1ebee72 commit 54f5883
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion erniebot/src/erniebot/backends/aistudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async def arequest(

@classmethod
def handle_response(cls, resp: EBResponse) -> EBResponse:
if "errorCode" in resp and resp["errorCode"] != 0:
if resp["errorCode"] != 0:
ecode = resp["errorCode"]
emsg = resp["errorMsg"]
if ecode in (4, 17):
Expand Down
2 changes: 2 additions & 0 deletions erniebot/src/erniebot/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,9 @@ def _interpret_response_line(
)

logging.debug("Decoded response body: %r", decoded_rbody)

response = EBResponse(rcode=rcode, rbody=decoded_rbody, rheaders=dict(rheaders))

if rcode != http.HTTPStatus.OK:
raise errors.HTTPRequestError(
f"The status code is not {http.HTTPStatus.OK}.",
Expand Down

0 comments on commit 54f5883

Please sign in to comment.