title: Custom ExceptionHandler in Angular 2
body: <p>I´m trying to implement a central ExceptionHandler in Angular 2. I searched in SO and found several topics about this subject, like those bellow:</p>
  
  <p><a href="https://stackoverflow.com/questions/32980405/module-angular2-angular2-has-no-exported-member-exceptionhandler">Module &#39;&quot;angular2/angular2&quot;&#39; has no exported member &#39;ExceptionHandler&#39;</a></p>
  
  <p><a href="https://stackoverflow.com/questions/16489058/how-to-properly-overwrite-the-exceptionhandler-in-angularjs">How to properly overwrite the exceptionHandler in angularjs?</a></p>
  
  <p>But, this topics seem to be outdated. </p>
  
  <p>I´m using Angular 2 RC5, and following the documentation <a href="https://angular.io/docs/ts/latest/api/core/index/ExceptionHandler-class.html" rel="nofollow noreferrer">here</a>, I tried to implement:</p>
  
  <pre><code>import { ExceptionHandler } from '@angular/core';
  export class CustomExceptionHandler implements ExceptionHandler {
  
  call(error:any, stackTrace:any = null, reason:string = null) {
      // do something with the exception
  }
  </code></pre>
  
  <p>}</p>
  
  <p>But I received a error like that <em>"TS2420 - CustomExceptionHandler incorrectly implements interface ExceptionHandler. Property '_logger' is missing in type 'CustomExceptionHandler'.</em>  </p>
  
  <p>I´am a newbie in TS, but I have been programming in Java for 10 years. </p>
  
  <p>Actually, when I click on ExceptionHandler in IDE (IntelliJ), the code follow up to a class, not a interface.</p>
  
  <pre><code>export declare class ExceptionHandler {
      private _logger;
      private _rethrowException;
      constructor(_logger: any, _rethrowException?: boolean);
      static exceptionToString(exception: any, stackTrace?: any, reason?: string): string;
      call(exception: any, stackTrace?: any, reason?: string): void;
  }
  </code></pre>