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

Document reportError as an option for reporting in browsers #13547

Open
camsteffen opened this issue Aug 31, 2024 · 3 comments
Open

Document reportError as an option for reporting in browsers #13547

camsteffen opened this issue Aug 31, 2024 · 3 comments
Labels
Package: browser Issues related to the Sentry Browser SDK Type: Tests

Comments

@camsteffen
Copy link

Problem Statement

I think the global reportError function could be an idiomatic way to report errors to Sentry from JavaScript, if it is not too general for your use case. I don't find much talk about this function on the webs, but it has been available across major browsers for some time.

Solution Brainstorm

The Capturing Errors and Events page of the docs could have a small section that mentions reportError as an alternative.

@camsteffen camsteffen changed the title Document reportError as an option for reporting in JavaScript Document reportError as an option for reporting in browsers Aug 31, 2024
@s1gr1d
Copy link
Member

s1gr1d commented Sep 2, 2024

Seems like a good idea, but captureException has some logic to it like getting the current scope. I guess using reportError alone would not work with the SDK and we would have to explicitly support it. Or how would you want it to be used? :)

Just putting this here for reference: https://developer.mozilla.org/en-US/docs/Web/API/reportError

However, we should verify the behavior of using this in an integration test. It could be that it just bubbles up and works OOTB.

@camsteffen
Copy link
Author

I believe it works out of the box and from Sentry's perspective it is just an unhandled error event.

@s1gr1d
Copy link
Member

s1gr1d commented Sep 3, 2024

Yeah, we will add an integration test for this 👍

@AbhiPrasad AbhiPrasad added Package: browser Issues related to the Sentry Browser SDK Type: Tests labels Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: browser Issues related to the Sentry Browser SDK Type: Tests
Projects
Status: No status
Development

No branches or pull requests

3 participants