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

Determine error source in beforeSend #3034

Open
jeremy-ap opened this issue Sep 24, 2024 · 3 comments
Open

Determine error source in beforeSend #3034

jeremy-ap opened this issue Sep 24, 2024 · 3 comments

Comments

@jeremy-ap
Copy link

Context
Errors logged on the console can contain sensitive information. What we've noticed is that if our app has injected scripts running on-top, for example a browser extension or in-app browser, it can throw errors in the console which may contain sensitive inputs from the DOM, and this results in the error being sent to Datadog.

Please correct me if I'm wrong, but I've checked the docs here and the issues tab but don't see a real way to determine if

  1. The error from the console is from our app, or an injected script
  2. If the error contains source maps or not

Describe the solution you'd like
Ideally we can determine if the error in beforeSend is coming from a domain that doesn't belong to ours
Or if the error does not have source maps attached (boolean attribute?)

Describe alternatives you've considered

  • We've looked at possibly using regex to filter our messages but that's an expensive endeavour. We'd like to explore if there's other alternatives available first
@cy-moi
Copy link
Contributor

cy-moi commented Sep 24, 2024

Hi @jeremy-ap ,
Thank you for reaching out. Have you tried to filter based on error.stack attribute ?

@jeremy-ap
Copy link
Author

@cy-moi thanks for getting back
We cannot use the error.stack because it does not always contain sufficient information for us

@cy-moi
Copy link
Contributor

cy-moi commented Sep 30, 2024

Hi @jeremy-ap ,
Do you own the injected scripts running on-top and would you need to tell which script the errors are from?

We support addError() with context. By adding context from your main app, hopefully it could help you in this case to distinguish the source of errors from 3rd party injected scripts.

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

2 participants