Why handle errors with catchError and not in the subscribe error callback in Angular
So I'd normally write my http requests like so Service getData(){ return this.http.get('url') } Component getTheData() { this.service.getData().subscribe( (res) => { //Do something }, (err) => { console.log('getData has thrown and error of', err) }) But looking through Angular documentation they seem to format it like so in a Service getHeroes(): Observable<Hero[]> { return this.http.get<Hero[]>(this.heroesUrl) .pipe( catchError(this.handleError('getHeroes', [])) ); } What's the implicit upside of this as it seems quite verbose to me and I've personally never had the need to pipe my errors. 1