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

Always return rejected promise when submit is rejected #1203

Merged
merged 3 commits into from
Jun 22, 2016
Merged

Conversation

erikras
Copy link
Member

@erikras erikras commented Jun 22, 2016

Addresses #1201.

Also removed returnRejectedSubmitPromise. That was put in as a stopgap measure to avoid a breaking change, but I think the promise that is returned from submitting should always be rejected if there was an error.

@ooflorent, please review.

@erikras erikras added this to the next-6.0.0 milestone Jun 22, 2016
@ooflorent
Copy link
Contributor

LGTM. I never liked returnRejectedSubmitPromise 👍

@erikras
Copy link
Member Author

erikras commented Jul 1, 2016

Published in v6.0.0-rc.1.

@@ -223,7 +223,10 @@ const createReduxForm =
return promise
}
this.submitPromise = promise
return promise.then(this.submitCompleted, this.submitCompleted)
return promise.then(this.submitCompleted, err => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As reported in #1266, this line throws undefined:1 Uncaught (in promise) Object { ...errors } if there are validation errors.

If I do this

return promise.then(this.submitCompleted, err => {
  this.submitCompleted()
  return Promise.reject(err)
}).catch(err => {
  console.log('==> CATCH', err)
})

the error is caught. Let's continue discussion in #1266

@erikras erikras deleted the reject-submit branch July 28, 2016 15:00
@lock
Copy link

lock bot commented Jun 2, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2018
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