mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
- Fixed typescript compile issue
This commit is contained in:
parent
1e410e75ea
commit
5533ed424a
@ -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';
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user