add catch-all exception handler per review feedback

This commit is contained in:
Luke Payyapilli
2026-01-29 09:07:06 -05:00
parent ff0eb6d286
commit 433c1b9b92
2 changed files with 39 additions and 1 deletions

View File

@@ -495,6 +495,8 @@ class BaseOpenAILLMService(LLMService):
except httpx.TimeoutException as e:
await self._call_event_handler("on_completion_timeout")
await self.push_error(error_msg="LLM completion timeout", exception=e)
except Exception as e:
await self.push_error(error_msg=f"Error during completion: {e}", exception=e)
finally:
await self.stop_processing_metrics()
await self.push_frame(LLMFullResponseEndFrame())