title: overwrite GlobalErrorHandler in Angular13
body: <p>I use a GlobalErrorHandler in my Angular Project but i want overwrite it to add method name or specific message in console or screen.
  I have tested following code without success</p>
  <pre><code>    export class GlobalErrorHandler implements ErrorHandler {
          constructor(
              private errorService: ErrorService,
              private logService: LogService) {}
       
          handleError(error) {
      //  const stack = environment.production ? null : Error().stack;
              console.log('Global'); // IMPORTANT: Rethrow the error otherwise it gets swallowed
              throw error;
          }
       
      }
       
      export class AppComponent {
       
          private apiUrl = 'https://localhost:8080/api/ZZZZusers';
       
          constructor(private http2: HttpClient) {}
          getHttpError2() {
              console.log('OK ICI');
              return this.http2.get(this.apiUrl).pipe(
                  retry(1),
                  catchError(this.handleError('mon MESSAGE', [])));
                   console.log('JAMAIS ICI');
          }
       
          private handleError &lt; T &gt; (operation = 'operation', result ?  : T) {
              return (error: any): Observable &lt; T &gt;  =&gt; {
                  console.log('DANS HANDLER AIE JAMAIS ON Y PASSE');
                  return of(result as T);
              };
          }
      }
  </code></pre>