fix aiohttp response text
This commit is contained in:
@@ -49,8 +49,9 @@ class ElevenLabsTTSService(TTSService):
|
|||||||
|
|
||||||
async with self._aiohttp_session.post(url, json=payload, headers=headers, params=querystring) as r:
|
async with self._aiohttp_session.post(url, json=payload, headers=headers, params=querystring) as r:
|
||||||
if r.status != 200:
|
if r.status != 200:
|
||||||
logger.error(f"Error getting audio (status: {r.status}, error: {r.text()})")
|
text = await r.text()
|
||||||
yield ErrorFrame(f"Error getting audio (status: {r.status}, error: {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
|
return
|
||||||
|
|
||||||
async for chunk in r.content:
|
async for chunk in r.content:
|
||||||
|
|||||||
@@ -745,8 +745,9 @@ class DailyTransport(BaseTransport):
|
|||||||
|
|
||||||
async with session.post(url, headers=headers, data=data) as r:
|
async with session.post(url, headers=headers, data=data) as r:
|
||||||
if r.status != 200:
|
if r.status != 200:
|
||||||
|
text = await r.text()
|
||||||
logger.error(
|
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
|
return
|
||||||
|
|
||||||
logger.debug("dialin-ready event handled successfully")
|
logger.debug("dialin-ready event handled successfully")
|
||||||
|
|||||||
Reference in New Issue
Block a user