ErrorHandler в Angular2

У меня есть вопрос о новом классе ErrorHandler (был включен в RC.6).

Я сделал пример из официальных документов:https://angular.io/docs/ts/latest/api/core/index/ErrorHandler-class.html

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 {}

После того, как я отредактировал файл app.module

import {MyErrorHandler} from "./error.module";
import {MyErrorModule } from "./error.module";
..
@NgModule({
    imports: [
        MyErrorModule
    ....
    ],
    ...
    providers: [MyErrorHandler]
   ....

Теперь MyErrorHandler ловит ошибки:

throw new Error("my test error");

Но это не ловит ошибки http, такие как: "GEThttp://example.com/rest/user 401 (Несанкционированный). Кто-нибудь может мне это объяснить?

Заранее спасибо!

Ответы на вопрос(2)

Ваш ответ на вопрос