-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Always throw network errors in useSupenseQuery
regardless of the error policy
#10401
Always throw network errors in useSupenseQuery
regardless of the error policy
#10401
Conversation
🦋 Changeset detectedLatest commit: 94c57f8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
29d1383
to
94c57f8
Compare
if ( | ||
result.error && | ||
errorPolicy === 'none' && | ||
const allowsThrownErrors = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic felt a bit heavy when reading this all inside the if
below. That being said, there are so many names here, its hard to keep coming up with new ones. If you have a suggestion for a better name for this variable, I'd love to hear it! At the very least, I want to make sure the if
statement below reads nicely and is easily understandable. If not, please let me know how I can update this to make it easier to understand the logic here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Closes #10384
Updates
useSuspenseQuery
to always throw network errors, regardless of theerrorPolicy
set in options. This is more in-line with howuseQuery
works when encountering a network error since theerror
is retained and theonError
callback is called.Checklist: