Skip to content
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

useSentry: Option to exclude errors from reporting #925

Closed
dburles opened this issue Nov 3, 2021 · 7 comments · Fixed by #936 or #947
Closed

useSentry: Option to exclude errors from reporting #925

dburles opened this issue Nov 3, 2021 · 7 comments · Fixed by #936 or #947
Assignees
Labels
kind/enhancement New feature or request stage/5-alpha-release-testing The pull request is merged, an alpha release is available, to be tested

Comments

@dburles
Copy link
Contributor

dburles commented Nov 3, 2021

Feature request

There's no way to exclude errors from being reported. Ideally there could be a configuration filter option to opt-out.

Something like:

useSentry({
  skipError(error) { return error instanceof MyCustomError; }
});

I'd suggest renaming skip to skipOperation if we go with skipError.

Bundling bug

I tried to extend my custom errors from EnvelopError as a workaround, though I was stumped as to why this didn't work until I realised for some reason it's actually being bundled into the Sentry plugin, https://unpkg.com/browse/@envelop/sentry@1.3.0/index.mjs so fails the instanceof check, when imported from @envelop/core.

@saihaj
Copy link
Collaborator

saihaj commented Nov 3, 2021

If you throw EnvelopError they are excluded from error reporting #855

@dburles
Copy link
Contributor Author

dburles commented Nov 3, 2021

That's what I was doing essentially, but it fails the instanceof check as it's not the same class as in core.

@n1ru4l
Copy link
Owner

n1ru4l commented Nov 3, 2021

@dburles Can you create a minimal reproduction of this?

@dburles
Copy link
Contributor Author

dburles commented Nov 3, 2021

This issue has kind of become two, a bug report for the bundled EnvelopError class and a feature request for a configuration option to skip errors, the latter is the part I am interested in. I would love to help and create a repro for the instanceof issue, but I cannot devote the time to it at the minute. I believe the problem is clear in any case and that it is solved by not bundling mono repo dependencies.

@n1ru4l n1ru4l mentioned this issue Nov 4, 2021
@n1ru4l
Copy link
Owner

n1ru4l commented Nov 4, 2021

@dburles This will be taken care of by #936. I will let you know once it is merged and released!

@n1ru4l n1ru4l reopened this Nov 8, 2021
@dotansimha dotansimha added kind/enhancement New feature or request stage/4-pull-request A pull request has been opened that aims to solve the issue labels Nov 9, 2021
@dotansimha
Copy link
Collaborator

@dburles This will be taken care of by #936. I will let you know once it is merged and released!

@dburles anything needs to be done on this PR? I think the changes Laurin mentioned are already in.

@dotansimha dotansimha added stage/5-alpha-release-testing The pull request is merged, an alpha release is available, to be tested and removed stage/4-pull-request A pull request has been opened that aims to solve the issue labels Nov 22, 2021
@dotansimha dotansimha reopened this Nov 22, 2021
@dotansimha
Copy link
Collaborator

Available in @envelop/sentry@1.5.0 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request stage/5-alpha-release-testing The pull request is merged, an alpha release is available, to be tested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants