In my project, we are using angularjs and RESTful APIs. Let's say I am trying to load a page, where we may be making calls to 6 rest apis. Say the first one fails- meaning I get a 200 but there is actually an exception that has occurred in the Java layer. How do I cancel all the future calls or rather stop those remaining 5 calls from being made? I am aware of the concept of interceptors and have referred to the following post
AngularJS abort all pending $http requests on route change
I am intercepting the response for each call to check if it has any error message that we are sending from the Java layer and then cancelling calls that have been registered in the array. But in case of the first call, that is the only one that will be present in the array. I am stuck with how to prevent further calls from happening.