redoc/lib/utils/custom-error-handler.ts
2017-03-29 13:29:54 +03:00

14 lines
385 B
TypeScript

import { ErrorHandler, Injectable } from '@angular/core';
import { AppStateService } from '../services/app-state.service';
@Injectable()
export class CustomErrorHandler extends ErrorHandler {
constructor(private appState: AppStateService) {
super();
}
handleError(error) {
this.appState.error.next(error && error.rejection || error);
super.handleError(error);
}
}