mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Add toJSON property to AxiosError type (#2427)
I noticed the error object has a `toJSON` method but when I tried to use it in my typescript code it complained it didn't exist, even though I was using the `AxiosError` type.
This commit is contained in:
committed by
Felipe Martins
parent
88dbb82d77
commit
006b60425c
Vendored
+1
@@ -82,6 +82,7 @@ export interface AxiosError<T = any> extends Error {
|
|||||||
request?: any;
|
request?: any;
|
||||||
response?: AxiosResponse<T>;
|
response?: AxiosResponse<T>;
|
||||||
isAxiosError: boolean;
|
isAxiosError: boolean;
|
||||||
|
toJSON: () => object;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AxiosPromise<T = any> extends Promise<AxiosResponse<T>> {
|
export interface AxiosPromise<T = any> extends Promise<AxiosResponse<T>> {
|
||||||
|
|||||||
Reference in New Issue
Block a user