title: ErrorHandler & RxJS 6.2.2
body: <p>I have an application with an globalError handler like this:</p>
  
  <pre><code>import { Injectable, ErrorHandler, Injector } from "@angular/core";
  import { Router } from "@angular/router";
  
  @Injectable()
  export class GlobalErrorHandler implements ErrorHandler {
  
    constructor(
      private injector: Injector) { }
  
  
    public handleError(error: any) {
      console.error("Something went wrong");
      //.. Handle error here
    }
  }
  </code></pre>
  
  <p>This always worked in every constallation. If an error was thrown the global handler caught it and handled it.</p>
  
  <p>Now after upgrading to RxJs 6.2.2 I understood that catching http errors changed.</p>
  
  <p>Code errors still keep working but errors thrown by the HttpClient are not globally caught. The GlobalErrorHandler is not fired any more.</p>
  
  <p>I am aware that I can handle errors within my service and that works fine like this:</p>
  
  <pre><code>doSomething() {
      return this.http
        .get("http://someURL").pipe(
        map((res: any) =&gt; { console.log(res) }),
          catchError(this.handleError&lt;any&gt;(`blabla`))
        );
    }
  
    /**
   * 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; {
        console.log("Now throwing error");
        // TODO: send the error to remote logging infrastructure
        console.error(error); // log to console instead
        // Let the app keep running by returning an empty result.
        // ToDo: Global Error handler hier aufrufen....
        return of(result as T);
      };
    }
  </code></pre>
  
  <p>But I actually would like to handle all errors centrally.</p>
  
  <p><strong>What is the correct way with Angular 6 and RxJs 6 to handle errors centrally?</strong></p>