mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-14 21:06:34 +03:00
14 lines
389 B
TypeScript
14 lines
389 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(true);
|
|
}
|
|
handleError(error) {
|
|
this.appState.error.next(error && error.rejection || error);
|
|
super.handleError(error);
|
|
}
|
|
}
|