fix bug with history not being updated if image generation fails

This commit is contained in:
Abi Raja 2023-12-14 08:29:04 -05:00
parent 9494f4c1cc
commit f1a9859384

View File

@ -254,6 +254,9 @@ async def stream_code(websocket: WebSocket):
except Exception as e:
traceback.print_exc()
print("Image generation failed", e)
# Send set code even if image generation fails since that triggers
# the frontend to update history
await websocket.send_json({"type": "setCode", "value": completion})
await websocket.send_json(
{"type": "status", "value": "Image generation failed but code is complete."}
)