Skip to content

Commit

Permalink
fix: check to see that config is defined in processAxiosError (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Butterworth authored Dec 4, 2019
1 parent 8a2983d commit 58f63a3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/auth/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ const processAxiosError = (axiosErrorObject) => {
const error = Object.create(axiosErrorObject);
const { request, response, config } = error;

if (!config) {
error.customAttributes = {
...error.customAttributes,
httpErrorType: 'unknown-api-request-error',
};
return error;
}

const {
url: httpErrorRequestUrl,
method: httpErrorRequestMethod,
Expand Down

0 comments on commit 58f63a3

Please sign in to comment.