AngularでBugsnagを利用

Angular4始めました。
Angularでエラーをインターセプトする場合はこんな感じ。

import { ErrorHandler, Injectable} from '@angular/core';
import { environment } from '../environments/environment';

@Injectable()
export class GlobalErrorHandler implements ErrorHandler {
  constructor() {
    Bugsnag.releaseStage =  = environment.production ? 'production' : 'develop';
  }
  handleError(error) {
    Bugsnag.notifyException(error);
    throw error;
  }
}

// ---

@NgModule({
  providers: [{
    provide: ErrorHandler,
    useClass: GlobalErrorHandler
  }]
})
export class AppModule { }

https://angular.io/api/core/ErrorHandler