fix(utils.py): exception mapping on 'next()' streaming error

This commit is contained in:
Krrish Dholakia 2024-03-29 09:18:41 -07:00
parent 109cd93a39
commit 41fb76740e

View file

@ -9704,7 +9704,14 @@ class CustomStreamWrapper:
threading.Thread( threading.Thread(
target=self.logging_obj.failure_handler, args=(e, traceback_exception) target=self.logging_obj.failure_handler, args=(e, traceback_exception)
).start() ).start()
if isinstance(e, OpenAIError):
raise e raise e
else:
raise exception_type(
model=self.model,
original_exception=e,
custom_llm_provider=self.custom_llm_provider,
)
async def __anext__(self): async def __anext__(self):
try: try: