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

seblegall
Copy link
Contributor

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 April 11, 2018 14:48
@codecov-io
Copy link

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
@seblegall seblegall deleted the doc/catch-api-errors branch April 20, 2018 10:05
@github-actions
Copy link

This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants