- Fixed typescript compile issue

This commit is contained in:
Ferdi Koomen 2021-11-18 22:38:39 +01:00
parent 1e410e75ea
commit 5533ed424a
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{{>header}}
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
import Blob from 'cross-blob'
import FormData from 'form-data';

View File

@ -22,8 +22,9 @@ async function sendRequest(
try {
return await axios.request(config);
} catch (error) {
if (error.response) {
return error.response;
const axiosError = error as AxiosError;
if (axiosError.response) {
return axiosError.response;
}
throw error;
}