Skip to content

Question regarding UnhandledRejection exception when testing new configuration of Sentry v6 on Angular v8 #13636

@edgariscoding

Description

@edgariscoding

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/angular

SDK Version

6.19.7

Framework Version

Angular 8.0.3

Link to Sentry event

No response

Reproduction Example/SDK Setup

Our application is Angular 8 so we have to use Sentry 6.

main.ts

// Angular imports
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import * as Sentry from "@sentry/angular";

// Environment imports
import { environment } from './environments/environment';

// Module import
import { AppModule } from './app/app.module';

Sentry.init({
  dsn: "https://[email protected]/3"
});

if (environment.production) {
    enableProdMode();
}

platformBrowserDynamic()
    .bootstrapModule(AppModule)
    .then((success) => console.log('Bootstrap success'))
    .catch((err) => console.error(err));

app.module.ts

Image

Steps to Reproduce

I added a button in the UI and calling a method which throws an error.

Image

When this is triggered, a sentry issue is created but it's shown as an Unhandled Rejection.

If i scroll down far enough i see the test error

Image

But why does Unhandled Rejection show up first?

Expected Result

I expected the Sentry issue to show "Sentry Test Error" as the issue title.

Actual Result

Image

What am i doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: angularIssues related to the Sentry Angular SDK

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions