license import { ErrorHandler , Injectable } from '@angular/core' ; import { LoggerService } from './logger/logger.service' ; @ Injectable ( ) export class GlobalErrorHandler implements ErrorHandler { constructor ( private logger ) { } handleError ( error ) { this . logger . error ( error ) ; } }