mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-05 07:37:50 +00:00
refactor: clean up fresh tech debt in auth 401 detection, cooldown fallback lookup and bedrock guardrail billing
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
9940fa29dc
commit
d497e02bbf
1 changed files with 1 additions and 2 deletions
|
|
@ -53,8 +53,7 @@ def is_unauthorized_error(exception: BaseException | None) -> bool:
|
|||
if not isinstance(exception, (HTTPException, ProxyException)):
|
||||
return False
|
||||
|
||||
code: Final[object] = getattr(exception, "code", None)
|
||||
status_code: Final[object] = code if code is not None else getattr(exception, "status_code", None)
|
||||
status_code: Final[object] = exception.code if isinstance(exception, ProxyException) else exception.status_code
|
||||
return str(status_code) == str(status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue