(error: Error)
| 155 | } |
| 156 | |
| 157 | function getApiError(error: Error): { message?: string; code?: string } | undefined { |
| 158 | const maybeResponse = error as Error & { |
| 159 | response?: { |
| 160 | data?: { |
| 161 | message?: string; |
| 162 | code?: string; |
| 163 | }; |
| 164 | }; |
| 165 | }; |
| 166 | |
| 167 | return maybeResponse.response?.data; |
| 168 | } |