Closed matthewrfindley closed 9 years ago
I agree, I am curious as well, but only wanted to find a quick solution to the problem.
FYI: there is a strange scenario with then/catch chaining and promises that this made me think of.
Try this:
Promise.resolve('foo').then(() => {throw new Error('error')}).catch((e) => console.log(e)).then(() => console.log('in second then'))
You will see that the catch logs the error, as expected, but then the "in second then" log is also show. The behavior is that unless the catch throws the error again, subsequent items chained on will start executing again normally.
This change would break that behavior, but I don't believe we are actually using that behavior anywhere (yet). And we are definitely relying on the behavior of a thrown error skipping execution of subsequent then blocks, so I'm totally on board with this change. I just wanted to point this out for future reference.
My question is not a blocker, just curiosity. This looks good! :+1: