Skip to content

Commit c2e3977

Browse files
nortonprojectskamilogorek
authored andcommitted
docs: Angular - added error console logging outside of production (#1340)
Without calling `super.handleError(err)`, Raven swallows the error without any indication for debugging in development environments
1 parent aca0802 commit c2e3977

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/integrations/angular.rst

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Then, in your main module file (where ``@NgModule`` is called, e.g. app.module.t
6262
import { BrowserModule } from '@angular/platform-browser';
6363
import { NgModule, ErrorHandler } from '@angular/core';
6464
import { AppComponent } from './app.component';
65+
import { environment } from '../environments/environment';
6566
6667
Raven
6768
.config('___PUBLIC_DSN___')
@@ -70,6 +71,9 @@ Then, in your main module file (where ``@NgModule`` is called, e.g. app.module.t
7071
export class RavenErrorHandler implements ErrorHandler {
7172
handleError(err:any) : void {
7273
Raven.captureException(err.originalError || err);
74+
if(!environment.production) {
75+
super.handleError(err);
76+
}
7377
}
7478
}
7579

0 commit comments

Comments
 (0)