fix aiohttp response text

This commit is contained in:
Aleix Conchillo Flaqué
2024-05-23 15:51:00 -07:00
parent fac43cea06
commit 88f6436aaa
2 changed files with 5 additions and 3 deletions

View File

@@ -49,8 +49,9 @@ class ElevenLabsTTSService(TTSService):
async with self._aiohttp_session.post(url, json=payload, headers=headers, params=querystring) as r:
if r.status != 200:
logger.error(f"Error getting audio (status: {r.status}, error: {r.text()})")
yield ErrorFrame(f"Error getting audio (status: {r.status}, error: {r.text()})")
text = await r.text()
logger.error(f"Error getting audio (status: {r.status}, error: {text})")
yield ErrorFrame(f"Error getting audio (status: {r.status}, error: {text})")
return
async for chunk in r.content:

View File

@@ -745,8 +745,9 @@ class DailyTransport(BaseTransport):
async with session.post(url, headers=headers, data=data) as r:
if r.status != 200:
text = await r.text()
logger.error(
f"Unable to handle dialin-ready event (status: {r.status}, error: {r.text()})")
f"Unable to handle dialin-ready event (status: {r.status}, error: {text})")
return
logger.debug("dialin-ready event handled successfully")