(e: AxiosError)
| 175 | } |
| 176 | |
| 177 | export function errorMsgFromAxiosError(e: AxiosError): string { |
| 178 | if (e.response) { |
| 179 | return `with status code ${e.response.status}`; |
| 180 | } else if (e.request) { |
| 181 | return 'with no response'; |
| 182 | } else { |
| 183 | return 'in building the HTTP request'; |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | export async function performApiCall( |
| 188 | payload: ApiCallPayload |