Skip to content

Commit

Permalink
Return the full axios error on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
waxlamp committed Mar 18, 2021
1 parent 1d7f428 commit f46df0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function fileToText(file: File): Promise<string> {
function extract<T>(promise: AxiosPromise<T>): Promise<T> {
return new Promise((resolve, reject) => {
promise.then((resp) => resolve(resp.data))
.catch((err) => reject(err.response));
.catch((err) => reject(err));
});
}

Expand Down

0 comments on commit f46df0c

Please sign in to comment.