cujojs / when

A solid, fast Promises/A+ and when() implementation, plus other async goodies.
Other
3.44k stars 396 forks source link

When and Q Reject #431

Closed pcfreak30 closed 9 years ago

pcfreak30 commented 9 years ago

I am using phbridge and when rejecting a nested Q promise (via reject() callback) the code logic goes to node_modules/phridge/node_modules/when/lib/decorators/unhandledRejection.js:80 and ending the app instead of bubbling up the rejection. This causes me to have to set an error flag in a parent scope and reject elsewhere based on that..

When.js library version 3.7.2 is running

Thanks.

briancavalier commented 9 years ago

Hey @pcfreak30. I'm not sure what phbridge is, can you help me out with a link or more info?

Do you have a runnable test case you can post? Or at least enough of a representative example so I can understand the situation? Thanks!

Also, I figure node is probably halting with a stack trace. Could you post the stack trace as well?

The only way the code can end up at that line, is if someone is calling done at the end of a when.js promise chain, and that chain rejects without the rejection ever being handled. That behavior is the []intended behavior of done](https://github.com/cujojs/when/blob/master/docs/api.md#promisedone). However, if you can provide a test case, we can verify that it's all working as intended, or if there's a bug.

briancavalier commented 9 years ago

Ping @pcfreak30. Can you provide more info, or shall we close this?

briancavalier commented 9 years ago

@pcfreak30 Since it's been a while, I'm closing this. If you can provide an update and/or more info, please reopen.