(response: Response)
| 194 | } |
| 195 | |
| 196 | async function getErrorMessage(response: Response): Promise<string> { |
| 197 | try { |
| 198 | const data = (await response.json()) as { message?: string } |
| 199 | return data.message ?? `massCode API error: ${response.status}` |
| 200 | } |
| 201 | catch { |
| 202 | return `massCode API error: ${response.status}` |
| 203 | } |
| 204 | } |