Skip to content

captureException with the js sdk in Angular #2409

@hdayacr

Description

@hdayacr

There is a lot of captureException and incomprehensible (like “Object.s” as title ) errors in Sentry

There is my configuration

    "@angular/animations": "^8.0.0",
    "@angular/cdk": "^8.0.0",
    "@angular/common": "^8.0.0",
    "@angular/compiler": "^8.0.0",
    "@angular/core": "^8.0.0",
    "@angular/forms": "^8.0.0",
    "@angular/material": "^8.0.0",
    "@angular/platform-browser": "^8.0.0",
    "@angular/platform-browser-dynamic": "^8.0.0",
    "@angular/platform-server": "^8.0.0",
    "@angular/router": "^8.0.0",
    "@sentry/browser": "^5.11.2",

in my main. module.ts:

Sentry.init({
     dsn: 'BLABLABLA',
     release: environment.version,
     environment: environment.production === true ? 'production' : 'staging'
 });

...

export class SentryErrorHandler extends ErrorHandler {

 constructor() {
     super();
 }

 handleError(err: any): void {
     if (environment.production === true || environment.preprod === true) {
         Sentry.captureMessage(err.originalError || err);
     }
     throw err;
 }
}
...

providers: [
     {provide: ErrorHandler, useClass: SentryErrorHandler},
...

I changed from Sentry.captureException to Sentry.captureMessage but the problem is still present.

Screenshot of the exceptions thrown:

Capture d’écran 2020-02-03 à 11 17 36

Capture d’écran 2020-02-03 à 11 17 49

As you can see in the screenshot, there is a “synthetic error” thrown in the sentry sdk code base.

Everything is configured as the documentation mention it, I also upload the sourcemaps correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions