fix(fastapi): yield SSEErrorResponse on outline parse instead of raising

This commit is contained in:
sauravniraula 2025-09-15 22:08:17 +05:45
parent 7aa168ac5b
commit c6ca4fe8a7
No known key found for this signature in database
GPG key ID: 60FCC1B5A5E83326

View file

@ -89,10 +89,10 @@ async def stream_outlines(
)
except Exception as e:
traceback.print_exc()
raise HTTPException(
status_code=400,
detail="Failed to generate presentation outlines. Please try again.",
)
yield SSEErrorResponse(
detail=f"Failed to generate presentation outlines. Please try again. {str(e)}",
).to_string()
return
presentation_outlines = PresentationOutlineModel(**presentation_outlines_json)