Skip to content

Commit 5b32db0

Browse files
committed
refactor(api): fix linting issue with try block
1 parent 0c820a7 commit 5b32db0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/typesense/request_handler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@ def _get_error_message(response: requests.Response) -> str:
261261
content_type = response.headers.get("Content-Type", "")
262262
if content_type.startswith("application/json"):
263263
try:
264-
err_message: str = response.json().get("message", "API error.")
265-
return err_message
264+
return typing.cast(str, response.json().get("message", "API error."))
266265
except requests.exceptions.JSONDecodeError:
267266
return f"API error: Invalid JSON response: {response.text}"
268267
return "API error."

0 commit comments

Comments
 (0)