-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
docs: Extend simple example to handle failed request #3322
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
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tanstack/react-query/D47AHsyRqnYHw1HkhqAN263QtxHj |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 99284e5:
|
I would want to keep the simple example as simple as possible (minimal lines of code). |
Fair point. I changed the PR to use |
interesting that we had axios in the dependencies already 😅 |
Codecov Report
@@ Coverage Diff @@
## master #3322 +/- ##
=======================================
Coverage 96.47% 96.47%
=======================================
Files 45 45
Lines 2271 2271
Branches 639 639
=======================================
Hits 2191 2191
Misses 77 77
Partials 3 3 Continue to review full report at Codecov.
|
🎉 This PR is included in version 4.0.0-alpha.20 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.34.17 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hey there,
I recently stumpled across a misunderstanding of the library and the referenced simple example.
Since the example contains an error handling with respect to the UI, it should also correctly recognize occurring errors. As mentioned in the docs, fetch and other clients do not throw by default an error - so I added the error handling to the example within the result handler.