Explore the code playground here => https://stackblitz.com/edit/playground-rxjs-f8xjsh
Hello there, I'm attempting to replicate a failed API Call scenario where the error value should be emitted at the subscribe() { Error: } section.
import { from, of, pipe, forkJoin, interval, AsyncSubject, BehaviorSubject,defer, Subject, timer, observable, throwError } from 'rxjs';
import { concatMap, map, mergeMap, zipWith, delay, tap, concatAll, concat, concatWith, switchMap, catchError } from 'rxjs/operators';
const apiCall = (callNumber, isError=false) => of('Api Call Result ' + callNumber).pipe(
tap(_=>console.log('Making API Call ' + callNumber)),
delay(1000),
tap(_=> throwError(() => new Error('ERROR')))
);
apiCall(99,true).subscribe({
next: x=>console.log(x),
error: e=>console.log(e)
});
Currently, the error is not getting caught or logged. Any assistance would be appreciated.
Stackblitz Link => https://stackblitz.com/edit/playground-rxjs-f8xjsh