cujojs / when

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

Catch does not resolve returned promises #379

Closed jescalan closed 9 years ago

jescalan commented 9 years ago

I have a situation in which I need to catch an error, and based on a condition, run another promise before continuing on. If I'm not mistaken, promise.catch does not resolve returned promises at the moment before continuing -- is it possible to add this functionality?

briancavalier commented 9 years ago

Hey @jenius! Yes, catch will wait for a promise that is returned from its handler. Double check that you're returning a promise. Also, if you can also post an example of your situation, we can have a look and figure out what is going on.

briancavalier commented 9 years ago

Ping ... have you had a chance to look at this again?

briancavalier commented 9 years ago

Afaict, this is working correctly. Please do reopen if you have a case where you feel it isn't.

jescalan commented 9 years ago

Hey sorry just noticed this. I think I'm still having this issue but I'll check again and mention here if I have a reproduction case.

briancavalier commented 9 years ago

Recording the outcome here for anyone who lands on this: discussed with @jenius via IRC and catch is working correctly. It does await promises returned from onRejected handlers.