import * as Raven from 'raven-js' ; import { ErrorHandler } from '@angular/core' ; import { Injectable } from '@angular/core' ; @ Injectable ( { providedIn : 'root' } ) export class RavenErrorHandler implements ErrorHandler { setup ( dsn ) { if ( ! Raven . isSetup ( ) && dsn ) { Raven . config ( dsn , { environment : 'web-frontend' , release : '$TRAVIS_COMMIT' , } ) . install ( ) ; } } handleError ( error ) { if ( Raven . isSetup ( ) ) { Raven . captureException ( error ) ; } console . error ( error ) ; } }