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:
jesus 2026-09-07 09:55:48 +00:00
parent 2b14762d0f
commit 208e37cb04

View file

@ -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: