( response: Response, label: string )
| 38 | const MAX_TTS_JSON_BYTES = Math.ceil((MAX_TTS_AUDIO_BYTES * 4) / 3) + 256 * 1024 |
| 39 | |
| 40 | async function readTtsErrorJson( |
| 41 | response: Response, |
| 42 | label: string |
| 43 | ): Promise<Record<string, unknown>> { |
| 44 | return readResponseJsonWithLimit<Record<string, unknown>>(response, { |
| 45 | maxBytes: MAX_TTS_ERROR_BYTES, |
| 46 | label, |
| 47 | }).catch(() => ({})) |
| 48 | } |
| 49 | |
| 50 | function getTtsErrorMessage(error: Record<string, unknown>, fallback: string): string { |
| 51 | const nested = error.error |
no test coverage detected