We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72a2b5a commit 3ff1196Copy full SHA for 3ff1196
clients/python/llmengine/errors.py
@@ -81,7 +81,7 @@ def parse_error(status_code: int, content: bytes) -> Exception:
81
try:
82
payload = json.loads(content)
83
message = payload["detail"]
84
- except json.JSONDecodeError:
+ except (json.JSONDecodeError, KeyError):
85
message = content.decode("utf-8")
86
87
# Try to parse a APIInference error
@@ -93,7 +93,7 @@ def parse_error(status_code: int, content: bytes) -> Exception:
93
return NotFoundError(message)
94
if status_code == 429:
95
return RateLimitExceededError(message)
96
- if 600 < status_code <= 500:
+ if 500 <= status_code < 600:
97
return ServerError(status_code, message)
98
99
# Fallback to an unknown error
0 commit comments