Skip to content

Commit

Permalink
Fix some oddities in the client (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanshi-scale authored Jul 10, 2024
1 parent 72a2b5a commit 3ff1196
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clients/python/llmengine/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def parse_error(status_code: int, content: bytes) -> Exception:
try:
payload = json.loads(content)
message = payload["detail"]
except json.JSONDecodeError:
except (json.JSONDecodeError, KeyError):
message = content.decode("utf-8")

# Try to parse a APIInference error
Expand All @@ -93,7 +93,7 @@ def parse_error(status_code: int, content: bytes) -> Exception:
return NotFoundError(message)
if status_code == 429:
return RateLimitExceededError(message)
if 600 < status_code <= 500:
if 500 <= status_code < 600:
return ServerError(status_code, message)

# Fallback to an unknown error
Expand Down

0 comments on commit 3ff1196

Please sign in to comment.