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

Uncaught (in promise) errors #10

Open
zomars opened this issue Sep 20, 2018 · 1 comment
Open

Uncaught (in promise) errors #10

zomars opened this issue Sep 20, 2018 · 1 comment

Comments

@zomars
Copy link

zomars commented Sep 20, 2018

Are you submitting a bug report or a feature request?

This is a bug report.

What is the current behavior?

When a promise is rejected the error is not being caught.

What is the expected behavior?

The error being caught.

Sandbox Link

https://codesandbox.io/s/qqwn5vn1rj

What's your environment?

I'm using redux-promise-listener v1.1.0 and react-redux-promise-listener v1.0.0

Other information

I've described the issue here also.

@lutangar
Copy link

lutangar commented Nov 21, 2018

It's not very straightforward, but there is note somewhere stating the following:

Final Form expects submit errors to come back in a resolved promise.

Something like this worked for me:

    <MakeAsyncFunction
      listener={promiseListener}
      start="START_ACTION_TYPE" // the type of action to dispatch when this function is called
      resolve={({ type }) => type === RESOLVE_ACTION_TYPE || type === REJECT_ACTION_TYPE} // the type of action that will resolve the promise 
    >

As a side note, even if the prop type is string inreact-redux-promise-listener, redux-promise-listener can take an action matcher as well as a string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants