Here is the code snippet in question:
subscriber.pipe(
switchMap(data => {
this.getData().pipe(
map(() => res),
catchError(error => {
return of(null);
})
);
}),
switchMap(data => {
})
).subscribe();
If an error occurs in the first switchMap and null is returned, the next switchMap will receive null data. However, I would like to halt the execution if the first switchMap goes into the catchError block, preventing the second switchMap from being executed. Is there a way to achieve this?