(body: unknown, fallback: string)
| 135 | } |
| 136 | |
| 137 | function messageFromErrorBody(body: unknown, fallback: string): string { |
| 138 | if (body && typeof body === 'object') { |
| 139 | const record = body as Record<string, unknown> |
| 140 | const message = record.message ?? record.error |
| 141 | if (typeof message === 'string' && message.length > 0) return message |
| 142 | } |
| 143 | |
| 144 | return fallback |
| 145 | } |
| 146 | |
| 147 | function codeFromErrorBody(body: unknown): string | undefined { |
| 148 | if (body && typeof body === 'object') { |
no outgoing calls
no test coverage detected