Skip to content

Commit

Permalink
rename error message var
Browse files Browse the repository at this point in the history
  • Loading branch information
adnaans committed Jul 29, 2024
1 parent 720eff6 commit 290e5f5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions vocode/streaming/synthesizer/play_ht_synthesizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,15 @@ async def create_speech_uncached(
if not response.ok:
response_json = await response.json()
if response_json and "error_message" in response_json:
message = response_json["error_message"]
error_message = response_json["error_message"]
else:
message = f"Request to Play.HT failed with status code {str(response.status)}"
error_message = (
f"Request to Play.HT failed with status code {str(response.status)}"
)

raise PlayHTV1APIError(
f"Play.ht API error status code {response.status}",
message,
error_message,
)
if response.status == 429 and attempt < max_backoff_retries - 1:
await asyncio.sleep(backoff_retry_delay)
Expand Down

0 comments on commit 290e5f5

Please sign in to comment.