⚗️ Angular- Add error handling integration#4358
⚗️ Angular- Add error handling integration#4358rgaignault wants to merge 6 commits intoromanG/angular-integrationfrom
Conversation
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 37da729 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
5d02daf to
cc41070
Compare
cc41070 to
7284bc7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7284bc7112
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
7284bc7 to
a77040b
Compare
a77040b to
7cd6e04
Compare
packages/rum-angular/src/domain/error/provideDatadogErrorHandler.ts
Outdated
Show resolved
Hide resolved
packages/rum-angular/src/domain/error/provideDatadogErrorHandler.spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
❓ question: Why do you need this?
There was a problem hiding this comment.
@angular/core uses globalThis directly (without a guard), and that throw a reference error on chrome 63
There was a problem hiding this comment.
Oh interesting :)
Out of curiosity, do you have the reference in @angular/core where it’s used?
There was a problem hiding this comment.
Sure for context this is the gitlab job : https://gitlab.ddbuild.io/DataDog/browser-sdk/-/jobs/1521302268
Angular : https://github.com/angular/angular/blob/main/packages/core/src/util/global.ts
There was a problem hiding this comment.
Do you have any other idea to handle this ?
a369d88 to
37da729
Compare
Motivation
Add error handling to
@datadog/browser-rum-angular, complementing the router integration from #4315.When an Angular error occurs, without this integration it shows up as an anonymous unhandled error via
window.onerror. With this integration, errors are properly categorized as handled errors withframework: "angular"context and ahandling_stack.Changes
New exports:
provideDatadogErrorHandler()— Angular provider that replaces the defaultErrorHandler, reports errors to RUM then delegates tosuper.handleError()addAngularError(error)— standalone function for users with custom error handlersImplementation:
addErrorplugin API (same pattern as React'saddReactError)handling_stackviacreateHandlingStack('angular error')Tests:
addAngularError,provideDatadogErrorHandler, anddd_contextmergingdd_contextsupportRFC: https://datadoghq.atlassian.net/wiki/spaces/RUMP/pages/6387532503