-
Notifications
You must be signed in to change notification settings - Fork 278
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
Rejected promises log true
#133
Comments
This happens here: Line 432 in 906cf7b
Perhaps error.data is what should be logged? |
And only when error.data is truthy? Unsure. Seems like it should only |
@devinus Can you create a failing test? If there's a bug with a failing test I will fix it. |
See the catch block where the promise rejection is handled. https://github.com/dthree/vorpal/blob/62f77e1477ec11245c320b5d1d56b521c36ea6d8/lib/session.js#L482-488 The second param of onCompletion (data) is set to true, which is what ends up being output. It's worth noting that a non-promise callback that if (res && _.isFunction(res.then)) {
res.then(function (data) {
onCompletion(wrapper, undefined, data);
}).catch(function (err) {
// onCompletion(wrapper, true, err);
setTimeout(() => {
throw err
});
});
} I'm still not sure on what the intended behaviour is though, but exiting with 0 and logging 'true' cant be it. |
Hi! My personal workaround for now: I changed the onCompletet function in session.js:444 to:
Note: I needed a workaround fast, so i didn't get completely into it. I just needed it to work for my cause. |
According to comments in #35 the workaround can also be to reject promises with
|
The text was updated successfully, but these errors were encountered: