Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -50,6 +50,8 @@ async def generate(
|
|
50 |
)
|
51 |
image_url = response.data[0].url # 19. Get the image URL from the response
|
52 |
except Exception as e:
|
|
|
|
|
53 |
# 20. Return a JSON error message if the API call fails
|
54 |
return JSONResponse(content={"error": str(e)}, status_code=500)
|
55 |
|
|
|
50 |
)
|
51 |
image_url = response.data[0].url # 19. Get the image URL from the response
|
52 |
except Exception as e:
|
53 |
+
import traceback
|
54 |
+
print("Error in /generate:", traceback.format_exc())
|
55 |
# 20. Return a JSON error message if the API call fails
|
56 |
return JSONResponse(content={"error": str(e)}, status_code=500)
|
57 |
|