title: catchError of sample "https://angular.io/tutorial/toh-pt6" it's not working
body: <p>If you copy the class of hero.service.ts exposed on the Angular's docs page, you're going to see a problem on the call to <code>catchError(this.handleError&lt;any&gt;('updateHero'))</code>.</p>
  
  <p>The error is:</p>
  
  <p><a href="https://i.stack.imgur.com/GoHfZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GoHfZ.png" alt="enter image description here"></a></p>
  
  <p>Follow the complete typescript class:</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { HttpClient, HttpHeaders } from '@angular/common/http';
  
  import { Observable, of } from 'rxjs';
  import { catchError, map, tap } from 'rxjs/operators';
  
  import { Hero } from './hero';
  import { MessageService } from './message.service';
  
  const httpOptions = {
    headers: new HttpHeaders({ 'Content-Type': 'application/json' })
  };
  
  @Injectable({ providedIn: 'root' })
  export class HeroService {
  
    private heroesUrl = 'api/heroes';  // URL to web api
  
    constructor(
      private http: HttpClient,
      private messageService: MessageService) { }
  
      /** PUT: update the hero on the server */
        updateHero (hero: Hero): Observable&lt;any&gt; {
          return this.http.put(this.heroesUrl, hero, httpOptions).pipe(
            tap(_ =&gt; this.log(`updated hero id=${hero.id}`)),
            catchError(this.handleError&lt;any&gt;('updateHero'))
          );
        }
      /**
         * Handle Http operation that failed.
         * Let the app continue.
         * @param operation - name of the operation that failed
         * @param result - optional value to return as the observable result
         */
        private handleError&lt;T&gt; (operation = 'operation', result?: T) {
          return (error: any): Observable&lt;T&gt; =&gt; {
  
            // TODO: send the error to remote logging infrastructure
            console.error(error); // log to console instead
  
            // TODO: better job of transforming error for user consumption
            this.log(`${operation} failed: ${error.message}`);
  
            // Let the app keep running by returning an empty result.
            return of(result as T);
          };
        }
  
        /** Log a HeroService message with the MessageService */
        private log(message: string) {
          this.messageService.add(`HeroService: ${message}`);
        }
      }
  </code></pre>
  
  <p>Follow the error: </p>
  
  <pre><code>Argument type (error:any)=&gt;Observable&lt;Cart&gt; is not assignable to parameter type (err:any, caught:Observable&lt;T&gt;)=&gt; never
  </code></pre>