fix: error reporting on speech synthesis failures #2144
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Over the weekend, we hit a "maximum text length exceeded" error when trying to synthesize audio for a pre-fare (Sentry). Unfortunately we don't know exactly what the text was, because A) the code to log the error itself contained an error, and B) even if it had worked, we weren't logging the input text. Also, we probably wouldn't know it had happened at all, since this report would have only gone to the logs and not to Sentry.
This fixes the string interpolation in the logging, adds some needed context, and adds a Sentry report so we'll be notified when this happens again.
The current audio readout for this pre-fare is indeed rather close to the limit of 3,000 "billed characters" (exclusive of characters in SSML tags). I'll create a task for us to look into splitting up our speech somehow or cutting down on the number of characters.