Skip to content

Commit

Permalink
fix bug with history not being updated if image generation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
abi committed Dec 14, 2023
1 parent 9494f4c commit f1a9859
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/routes/generate_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ async def process_chunk(content: str):
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."}
)
Expand Down

0 comments on commit f1a9859

Please sign in to comment.