-
Notifications
You must be signed in to change notification settings - Fork 142
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
🐛 [RUM-87] AddError should support Error instances coming from other JS contexts #3144
🐛 [RUM-87] AddError should support Error instances coming from other JS contexts #3144
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3144 +/- ##
==========================================
- Coverage 93.71% 93.21% -0.50%
==========================================
Files 279 279
Lines 7682 7682
Branches 1718 1716 -2
==========================================
- Hits 7199 7161 -38
- Misses 483 521 +38 ☔ View full report in Codecov by Sentry. |
/to-staging |
Devflow running:
|
…staging-47 Integrated commit sha: 2f313ff Co-authored-by: roman.gaignault <roman.gaignault@datadoghq.com>
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
Should we do the same everytime we check
in the telemetry:
|
@@ -64,7 +65,7 @@ export class Logger { | |||
|
|||
if (error !== undefined && error !== null) { | |||
const rawError = computeRawError({ | |||
stackTrace: error instanceof Error ? computeStackTrace(error) : undefined, | |||
stackTrace: isError(error) ? computeStackTrace(error) : undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 suggestion: Could be nice to have a test about it.
Motivation
using DD_RUM.addError(error) but the error comes from a different context than the document (ex: created insde an iframe or a window.open), the SDK doesn not consider it as an Error instance and serializes it as JSON.
Changes
Use class object to determine if it's an error or not.
Testing
I have gone over the contributing documentation.