Skip to content

Commit

Permalink
fix: Incomplete URL logging on exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Josephasafg committed Sep 19, 2024
1 parent e811d74 commit f00726c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions ai21/http_client/async_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ async def execute_http_request(
raise exception

if response.status_code != httpx.codes.OK:
logger.error(
f"Calling {method} {self._base_url} failed with a non-200 response code: {response.status_code}"
)
logger.error(f"Calling {method} {response.url} failed with a non-200 response code: {response.status_code}")

if stream:
details = self._extract_streaming_error_details(response)
Expand Down
3 changes: 1 addition & 2 deletions ai21/http_client/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ def execute_http_request(

if response.status_code != httpx.codes.OK:
_logger.error(
f"Calling {method} {self._base_url} failed with a non-200 "
f"response code: {response.status_code} headers: {response.headers}"
f"Calling {method} {response.url} failed with a non-200 response code: {response.status_code}"
)

if stream:
Expand Down

0 comments on commit f00726c

Please sign in to comment.