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

Don't swallow errors #25

Closed
benjamingr opened this issue Feb 2, 2016 · 5 comments
Closed

Don't swallow errors #25

benjamingr opened this issue Feb 2, 2016 · 5 comments

Comments

@benjamingr
Copy link

The fact this middleware swallows errors makes debugging hard. I think for the very least in addition to marking error: true it would be useful to call a hook notifying the user of the error - at least when debugging.

@munjalpatel
Copy link

+1 -- I also need this functionality.

@aprct
Copy link

aprct commented Apr 28, 2016

+1

We can't develop without errors, unfortunately. Will be looking into something else until this is addressed.

@wwalser
Copy link

wwalser commented Jun 20, 2016

What you want has been addressed here.

Until a new version is published to NPM, the following work when you're using flux standard actions:

const asyncAction = performAsyncAction();
dispatch(asyncAction);
asyncAction.catch(err => console.log("here is my error:", err));
dispatch(performAsyncAction())
    .then(asyncActionResult => {
        if (asyncActionResult.error) {
            console.log("here is my error:", asyncActionResult.payload);
        }
    });

@pocesar
Copy link

pocesar commented Dec 9, 2016

that's actually how promises work. if you decide to use something like bluebird, it'll emit verbose warnings with stacktraces about unhandled rejections. you're in charge of handling your errors (as you would in try / catch statements, if / elses, etc)
plus it already propagate the rejection after dispatching the error https://github.com/acdlite/redux-promise/blob/master/src/index.js#L20

@benjamingr
Copy link
Author

@pocesar native promises and most libraries (NPO and RSVP lagging behind, but it's not a huge deal anymore) now emit warnings. This issue was about getting some indication about the error.

Note that this issue is old, and has since been addressed in both popular middlewares that do promises, I just forgot to close it.

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

5 participants