On an Angular 5 app I'm working on, I have to manually trigger an error for an observable. I have already looked at a similar question here, but without result. The function with the Observable has two nested observables (getSubscription in the example).
Here is a small example on Plunker (link).
My code is inside app.component.ts. triggerError and getSubscription are the key elements. The Important part are the two nested and dependent subscriptions. For simplicity I use the same call for both subscriptions, these should be placeholders for two nested subscriptions, in a real app these will be two different subscriptions
Whether an error is thrown or a successful response is sent, the subscription always jumps to the method with the successful outcome. How is it possible that the subscription will jump to the corresponding method in case of an error?
The structure with the two nested and interdependent subscriptions is very important and must be considered when proposing a solution!
this.earthquakeService.getRecentEarthquakesmethod inside the map function on it?