saycel / webph.one

The SayCel Webph.one - An App for Community Cell Networks
GNU Affero General Public License v3.0
11 stars 6 forks source link

Add support for sentry #75

Closed nicopace closed 7 years ago

nicopace commented 7 years ago

this is the code for having support of sentry in the app (extracted from https://sentry.webph.one/sentry/angular/getting-started/javascript-angular/):

import Raven = require('raven-js');
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ErrorHandler } from '@angular/core';
import { AppComponent } from './app.component';

Raven
  .config('https://f5e066d0fe54459e9568a70eb224734b@sentry.webph.one/2')
  .install();

export class RavenErrorHandler implements ErrorHandler {
  handleError(err:any) : void {
    Raven.captureException(err.originalError || err);
  }
}

@NgModule({
  imports: [ BrowserModule ],
  declarations: [ AppComponent ],
  bootstrap: [ AppComponent ],
  providers: [ { provide: ErrorHandler, useClass: RavenErrorHandler } ]
})
export class AppModule { }
rodrigomonelos commented 7 years ago

Might get back to this later