Spaces:
Running
Running
bravedims
commited on
Commit
·
091ae7a
1
Parent(s):
dd21570
Enhance ElevenLabs API error logging for better debugging
Browse files- Add detailed logging for ElevenLabs API status, response, URL, and headers
- Preserve original HTTPException details in error propagation
- Add full traceback logging for better error diagnosis
- This will help identify the exact ElevenLabs API issue
app.py
CHANGED
|
@@ -86,6 +86,10 @@ class ElevenLabsClient:
|
|
| 86 |
async with session.post(url, headers=headers, json=data) as response:
|
| 87 |
if response.status != 200:
|
| 88 |
error_text = await response.text()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
raise HTTPException(
|
| 90 |
status_code=400,
|
| 91 |
detail=f"ElevenLabs API error: {response.status} - {error_text}"
|
|
@@ -492,3 +496,4 @@ if __name__ == "__main__":
|
|
| 492 |
import uvicorn
|
| 493 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
| 494 |
|
|
|
|
|
|
| 86 |
async with session.post(url, headers=headers, json=data) as response:
|
| 87 |
if response.status != 200:
|
| 88 |
error_text = await response.text()
|
| 89 |
+
logger.error(f"ElevenLabs API Error - Status: {response.status}")
|
| 90 |
+
logger.error(f"ElevenLabs API Error - Response: {error_text}")
|
| 91 |
+
logger.error(f"ElevenLabs API Error - URL: {url}")
|
| 92 |
+
logger.error(f"ElevenLabs API Error - Headers: {headers}")
|
| 93 |
raise HTTPException(
|
| 94 |
status_code=400,
|
| 95 |
detail=f"ElevenLabs API error: {response.status} - {error_text}"
|
|
|
|
| 496 |
import uvicorn
|
| 497 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
| 498 |
|
| 499 |
+
|