Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)
Python
when all generations fail, print the all the underlying exceptions for debugging
Abi Raja6899c7792ef5
diff --git a/backend/routes/generate_code.py b/backend/routes/generate_code.pyindex e454ad05..866c7c0f 100644--- a/backend/routes/generate_code.py+++ b/backend/routes/generate_code.py@@ -1,5 +1,6 @@import asynciofrom dataclasses import dataclass+import tracebackfrom fastapi import APIRouter, WebSocketimport openaifrom codegen.utils import extract_html_content@@ -321,6 +322,12 @@ async def stream_code(websocket: WebSocket):)if all_generations_failed:await throw_error("Error generating code. Please contact support.")++ # Print the all the underlying exceptions for debugging+ for completion in completions:+ traceback.print_exception(+ type(completion), completion, completion.__traceback__+ )raise Exception("All generations failed")# If some completions failed, replace them with empty strings