Re:JavaScript Promises: There and back again
by iamwil on Tuesday December 17, 2013 @12:04PM
(#6922160)
I've had this issue with Q and when. Sometimes, things would fail inside a then chain, and then I can't figure out where exactly it failed, because though it fell through a couple thens, I'm not sure exactly where it came from, or how it got that way.
Re:JavaScript Promises: There and back again
by stu_k on Tuesday December 17, 2013 @12:52PM
(#6922516)
Have you tried setting
Q.longStackSupport = true
? This is invaluable for debugging (although it does slow things down a lot, so don't use it in production)
Re:JavaScript Promises: There and back again
by spion on Tuesday December 17, 2013 @07:28PM
(#6925000)
Yep, and this is exactly why its so nice to have promises built into the language. That way, the implementing engine could provide long stack traces for them as well as extra inspection and tooling of all currently pending async operations - and it could do that at the lowest possible performance cost.
The biggest issue for me is Q's habit of hiding errors despite me defining a Q.onerror handler. Hopefully a native implementation would fail a little louder.