8000 angular package - HttpErrorResponse is always null in defaultExtractor · Issue #2960 · getsentry/sentry-javascript · GitHub
[go: up one dir, main page]

Skip to content

angular package - HttpErrorResponse is always null in defaultExtractor #2960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JustDoItSascha opened this issue Oct 8, 2020 · 1 comment

Comments

@JustDoItSascha
Copy link
Contributor

Package + Version

  • [5.25.0] @sentry/angular

Description

In the packages/angular/src/errorhandler.ts#105 you do this: if (error instanceof HttpErrorResponse) {

But this line will always be false, because in your package.json you added @angular/common as dependency instead of peerDependency. This causes the issue that error is always an instance of the HttpErrorResponse of the main project but not an instance of the HttpErrorResponse sitting in the node_modules directory of your library.

This leads to the bug, that every HttpErrorResponse of Angular results in this in the sentry dashboard:

<unknown>
error
Handled unknown error

It can be solved by making at least the @angular/common dependency to a peerDependency.

@antgel
Copy link
antgel commented Aug 9, 2021

Can this be closed as it was merged last October?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
0