Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc : Add errors from API handling examples #633

Merged
merged 2 commits into from Apr 19, 2018

Conversation

Projects
None yet
3 participants
@seblegall
Copy link
Contributor

seblegall commented Apr 11, 2018

Fix Issue #582

I found out, by reading the source code, that aws-amplify is using Axios to handle http calls. This choice introduce a particular way of manage errors coming from API comparing to Fetch. (see this issue )

This PR is a proposal for explicitly tell developers that Axios is used.

By doing this, it also makes much clearer the use of an init object (called myInit in the examples) as a parameter of the get(), post(), etc. methods. This object is indeed, at the end, the documented param parameter in the corresponding methods in Axios.

It also warn the developers that status code > 299 are thrown as an exception. Which is not obvious when using Fetch.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@seblegall seblegall requested a review from mbahar as a code owner Apr 11, 2018

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Apr 11, 2018

Codecov Report

❗️ No coverage uploaded for pull request base (master@a414b1c). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #633   +/-   ##
=========================================
  Coverage          ?   89.19%           
=========================================
  Files             ?       69           
  Lines             ?     3221           
  Branches          ?      612           
=========================================
  Hits              ?     2873           
  Misses            ?      330           
  Partials          ?       18

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a414b1c...ebbda0c. Read the comment docs.

@mlabieniec mlabieniec merged commit 356dca6 into aws-amplify:master Apr 19, 2018

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@seblegall seblegall deleted the seblegall:doc/catch-api-errors branch Apr 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.