mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
refactor(http_handler): only follow __cause__ when unwrapping streamed body errors
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
2b14762d0f
commit
208e37cb04
1 changed files with 3 additions and 9 deletions
|
|
@ -318,15 +318,9 @@ def _find_base_llm_exception(error: BaseException, depth: int = 0) -> BaseLLMExc
|
|||
return error
|
||||
|
||||
cause: Final = error.__cause__
|
||||
if cause is not None:
|
||||
provider_exception: Final = _find_base_llm_exception(cause, depth + 1)
|
||||
if provider_exception is not None:
|
||||
return provider_exception
|
||||
|
||||
context: Final = error.__context__
|
||||
if context is not None:
|
||||
return _find_base_llm_exception(context, depth + 1)
|
||||
return None
|
||||
if cause is None:
|
||||
return None
|
||||
return _find_base_llm_exception(cause, depth + 1)
|
||||
|
||||
|
||||
class BaseLLMHTTPHandler:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue