I encountered a coding scenario like this
angular.forEach(config.tvshows.shows, function(show) {
promises.push($http.get('http://epguides.frecar.no/show/' + show.replace(/\s|\./g, '') + '/next/'));
});
return $q.all(promises).then(function(response) {
for (var i = 0; i < response.length; i++) {
service.shows.push(response[i]);
}
});
};
In this setup, I am collating a list of http requests called 'promises'. While most requests are successful, some may fail. It is crucial not to remove the failing request as it might succeed later.
Nevertheless, when a response fails, none of the responses are being stored in 'service.shows'. Is there a way to manage a 404 error or any other error response generated by an http request so that the code can proceed smoothly with the functioning requests?