title: ErrorHandler in Angular2
body: <p>I have a question about new class ErrorHandler (was included to RC.6).</p>
  
  <p>I did example from official docs:
  <a href="https://angular.io/docs/ts/latest/api/core/index/ErrorHandler-class.html" rel="noreferrer">https://angular.io/docs/ts/latest/api/core/index/ErrorHandler-class.html</a></p>
  
  <pre><code>import{ErrorHandler} from "@angular/core";
  import{NgModule} from "@angular/core";
  export class MyErrorHandler implements ErrorHandler {
  
      call(error: any, stackTrace: any = null, reason: any = null) {
          // do something with the exception
          console.log("do something with the exception");
      }
  
      // I handle the given error.
      public handleError( error: any ): void {
          console.log("I handle the given error");
      }
  
  }
  @NgModule({
      providers: [
          {
              provide: ErrorHandler,
              useClass: MyErrorHandler
          }
       ]
  })
  export class MyErrorModule {}
  </code></pre>
  
  <p>After I edited my app.module file </p>
  
  <pre><code>import {MyErrorHandler} from "./error.module";
  import {MyErrorModule } from "./error.module";
  ..
  @NgModule({
      imports: [
          MyErrorModule
      ....
      ],
      ...
      providers: [MyErrorHandler]
     ....
  </code></pre>
  
  <p>Now MyErrorHandler catches errors: </p>
  
  <pre><code>throw new Error("my test error");
  </code></pre>
  
  <p>But it doesn't catch http errors like: "GET <a href="http://example.com/rest/user" rel="noreferrer">http://example.com/rest/user</a> 401 (Unauthorized)". 
  Can anybody explain me it? </p>
  
  <p>Thanks in advance!</p>