mattupstate/angular-pipeline-example

View on GitHub
src/app/errors/sentry-error-handler.ts

Summary

Maintainability
A
0 mins
Test Coverage
import * as Sentry from '@sentry/browser';
import { ErrorHandler } from '@angular/core';
import { BrowserOptions } from '@sentry/browser';

export class SentryErrorHandler implements ErrorHandler {

  constructor(config: BrowserOptions) {
    Sentry.init(config);
  }

  handleError(error: any) {
    const eventId = Sentry.captureException(error.originalError || error);
    Sentry.showReportDialog({ eventId });
  }
}