Skip to content

fix: updates error handling to match axios#56

Merged
developit merged 2 commits intodevelopit:masterfrom
electricflannel:update-error-handling
Oct 9, 2020
Merged

fix: updates error handling to match axios#56
developit merged 2 commits intodevelopit:masterfrom
electricflannel:update-error-handling

Conversation

@electricflannel
Copy link
Copy Markdown
Contributor

Ran into an issue where we are passing the error message as part of the 400/500 body. The current implementation drops that data, where axios returns the body.

#48

@googlebot
Copy link
Copy Markdown
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link
Copy Markdown
Collaborator

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@electricflannel
Copy link
Copy Markdown
Contributor Author

@googlebot I fixed it.

@googlebot
Copy link
Copy Markdown
Collaborator

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@electricflannel
Copy link
Copy Markdown
Contributor Author

@developit I was wondering if we could get this merged in?

@developit
Copy link
Copy Markdown
Owner

Sorry for the delay.

Copy link
Copy Markdown
Owner

@developit developit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work. Only 3b larger!

@developit developit merged commit e624733 into developit:master Oct 9, 2020
@josuemontano
Copy link
Copy Markdown

Thanks for the fix! Would it be possible to have an npm release please?

@gianpaj
Copy link
Copy Markdown

gianpaj commented Dec 7, 2020

same here. @developit could you make a release, please? 🙏

@gianpaj
Copy link
Copy Markdown

gianpaj commented Dec 8, 2020

BTW we should add a test, like the one in axios:

should return JSON when rejecting
https://github.com/axios/axios/blob/master/test/specs/requests.spec.js#L234

I don't know how to mock an API call that returns an error message with karmatic
It probably needs to be added to this file:
https://github.com/developit/redaxios/blob/master/test/index.test.js

axios's project is using https://github.com/jasmine/jasmine-ajax - I wonder if need that too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants