I am querying a single API endpoint multiple times except with different parameters. For what ever reason some of these requests may fail and return a 500 error. If they do i still want the other requests to carry on and return me the data of all the successfull requests.
let terms = [];
terms.push(this.category.category);
terms = terms.concat(this.category.interests.map((x) => x.category));
for (let i = 0; i < terms.length; i++) {
const params = {
term: terms[i],
mode: 'ByInterest'
};
const request = this.evidenceService.get(this.job.job_id, params).map((res) => res.interactions);
this.requests.push(request);
}
const combined = Observable.forkJoin(this.requests);
combined.subscribe((res) => {
this.interactions = res;
});