Integration with angular sentry, Ref: #13

This commit is contained in:
Dominik Ziajka 2018-03-30 12:42:42 +02:00
parent 352a9a1fa3
commit d84af3dd4d
3 changed files with 19 additions and 1 deletions

View File

@ -42,6 +42,7 @@
"core-js": "^2.4.1",
"d3-ng2-service": "^1.23.3",
"npm-check-updates": "^2.13.0",
"raven-js": "^3.24.0",
"rxjs": "^5.4.1",
"zone.js": "^0.8.20"
},

View File

@ -1,5 +1,6 @@
import * as Raven from 'raven-js';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgModule, ErrorHandler } from '@angular/core';
import { HttpModule } from '@angular/http';
import { FormsModule } from '@angular/forms';
import { CdkTableModule } from "@angular/cdk/table";
@ -66,6 +67,17 @@ import { MoveLayerDownActionComponent } from './shared/node-context-menu/actions
import { MoveLayerUpActionComponent } from './shared/node-context-menu/actions/move-layer-up-action/move-layer-up-action.component';
import { ProjectMapShortcutsComponent } from './project-map/project-map-shortcuts/project-map-shortcuts.component';
Raven
.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726')
.install();
export class RavenErrorHandler implements ErrorHandler {
handleError(err:any) : void {
console.error(err.originalError || err);
Raven.captureException(err.originalError || err);
}
}
@NgModule({
declarations: [
@ -112,6 +124,7 @@ import { ProjectMapShortcutsComponent } from './project-map/project-map-shortcut
HotkeyModule.forRoot()
],
providers: [
{ provide: ErrorHandler, useClass: RavenErrorHandler },
D3Service,
VersionService,
ProjectService,

View File

@ -6851,6 +6851,10 @@ range-parser@^1.0.3, range-parser@^1.2.0, range-parser@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e"
raven-js@^3.24.0:
version "3.24.0"
resolved "https://registry.yarnpkg.com/raven-js/-/raven-js-3.24.0.tgz#59464d8bc4b3812ae87a282e9bb98ecad5b4b047"
raw-body@2, raw-body@2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.2.tgz#bcd60c77d3eb93cde0050295c3f379389bc88f89"