2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-27 14:47:43 +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:
Tiago Rodrigues
2019-09-26 14:11:34 +02:00
committed by Felipe Martins
parent 88dbb82d77
commit 006b60425c
Vendored
+1
View File
@@ -82,6 +82,7 @@ export interface AxiosError<T = any> extends Error {
request?: any;
response?: AxiosResponse<T>;
isAxiosError: boolean;
toJSON: () => object;
}
export interface AxiosPromise<T = any> extends Promise<AxiosResponse<T>> {