-
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
Don't call onError
if errors are thrown in onCompleted
#12174
Conversation
✅ Docs Preview ReadyNo new or changed pages found. |
🦋 Changeset detectedLatest commit: fe8cd6f 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 |
commit: |
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
size-limit report 📦
|
a260e06
to
9a71fc8
Compare
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Generally in favor of this, but I'm not sure if this is a patch or should at least be part of a minor, since it does change behaviour considerably and people might not read patch notes.
@phryneas I'd be happy to wait for a minor. I'd like to get |
04296c1
to
c7d6358
Compare
Fixes #12008
Errors thrown in
onCompleted
as a result of an error thrown insideonCompleted
exhibit two behaviors:errors
property on the resolved value from the mutationonError
is also called with the error thrown fromonCompleted
This is a bit surprising behavior as
onError
is meant to handle errors from the mutation.This PR moves the error handling from a
.catch
on the promise to the 2nd argument to.then
so that errors thrown inonCompleted
aren't handled the same way. This results in the mutation promise throwing that error instead and ensuresonError
is not called as a result.