I am seeking clarification on how errors travel through a series of then continuations to a catch continuation.
Consider the following code:
Promise.reject(new Error("some error"))
.then(v => v + 5)
.then(v => v + 15)
.catch(error => console.log(error));
Upon reaching line 1, we encounter a rejected promise. When the first continuation, .then(v => v + 5), is executed, the original rejected promise remains untouched. The same applies for line 3. As a result, none of the subsequent then continuations are executed. Instead, when the catch continuation is reached, the original object containing the error is passed along as the result.
Can I confirm that this assumption is accurate?