I have multiple chained, synchronous requests in my code. I am using the NodeJS package request-promise.
Here is some pseudocode to show how it is formatted:
initRequest.then(function(response){
return request2;
}).then(function(response2){
return request3;
}).then(function(response3){
return requestN;
}).catch(function(err){
log(error)
});
If, for example, request3 fails, what happens? Does the chain continue, or does it break out of the loop completely?
And if request2 was a POST, and request3 failed, is there a way to systematically roll back the data that request2 changed?
Thanks.