Is is possible to use the value returned from a previous then method in a then chain to the catch method if any of the next then methods fail?
So for instance if we have:
fetch('https://example.com')
.then( res => doSomething(res) )
.then( res2 => doSomethingElse(res2) )
.then( res3 => console.log(res3) )
.catch( res2 => console.log(res2) )
So say the second then fails (doSomethingElse), can I pass the value of the last successful then to the catch block? (in this case the first one would be the last one to pass)