mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-16 09:22:22 +00:00
refactor(proxy): parse a three-digit string status without recursing
This commit is contained in:
parent
cfec5a12e4
commit
1a0b73403d
1 changed files with 2 additions and 2 deletions
|
|
@ -65,8 +65,8 @@ def _http_error_status(value: object) -> int | None:
|
|||
return None
|
||||
case int() if value in _HTTP_ERROR_STATUSES:
|
||||
return value
|
||||
case str() if len(value) == 3 and value.isascii() and value.isdigit():
|
||||
return _http_error_status(int(value))
|
||||
case str() if len(value) == 3 and value.isascii() and value.isdigit() and int(value) in _HTTP_ERROR_STATUSES:
|
||||
return int(value)
|
||||
case _:
|
||||
return None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue