-
Notifications
You must be signed in to change notification settings - Fork 134
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
Comments
+1 -- I also need this functionality. |
+1 We can't develop without errors, unfortunately. Will be looking into something else until this is addressed. |
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);
}
}); |
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) |
@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. |
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.The text was updated successfully, but these errors were encountered: