You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How am I supposed to deal with the last exception? #18
SecondException() is lost, never handled.
But say for example that I have a PHP error handler that triggers exceptions.
Say then that I am in the middle of my work on the error handling closure (the second one above).
While I code it, I make mistakes, like usual.
How am I supposed to get the SecondException to my eyes so that I can have a great debugging experience? Adding a third "robust" ->then(null, 'debugProvedHandler')?
I'd prefer having an exception thrown from the last error handler be re-thrown, don't you?
Or any other way I'm missing?
At the moment, you only have the ->then(null, 'debugProvedHandler') possibility. Some promise libs have a done() method (see here for example). This would probably be a good addition...
Activity
jsor commentedon Aug 14, 2014
At the moment, you only have the
->then(null, 'debugProvedHandler')possibility. Some promise libs have adone()method (see here for example). This would probably be a good addition...nicolas-grekas commentedon Aug 14, 2014
OK, thanks, that would be great yes
jsor commentedon Aug 15, 2014
FYI: I found some time this morning and implemented done() in this branch: https://github.com/reactphp/promise/tree/extended-promise
See also:
https://github.com/reactphp/promise/tree/extended-promise#extendedpromiseinterfacedone
https://github.com/reactphp/promise/tree/extended-promise#done-vs-then
It's still experimental and open for discussion. Feel free to test it and give feedback.