Skip to content

Commit

Permalink
Add toJSON property to AxiosError type (#2427)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
trodrigues authored and felipewmartins committed Sep 26, 2019
1 parent 88dbb82 commit 006b604
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Expand Up @@ -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>> {
Expand Down

0 comments on commit 006b604

Please sign in to comment.