feat(client-telemetry-utils): Retain inner error as cause when wrapping errors#25485
Merged
feat(client-telemetry-utils): Retain inner error as cause when wrapping errors#25485
cause when wrapping errors#25485Conversation
…ping errors but do not log `cause` property itself.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for preserving inner errors as the cause property when wrapping errors, following the ES2022 Error.cause standard. The key change ensures that when errors are wrapped, the original error is retained for debugging purposes while preventing the cause property itself from being logged as telemetry data.
Key changes:
- Added
causeproperty toIFluidErrorBaseinterface with comprehensive documentation - Modified
wrapErrorfunction to set thecauseproperty to the inner error - Updated
LoggingErrorclass to exclude thecauseproperty from telemetry logging - Added comprehensive test coverage for the new functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/utils/telemetry-utils/src/fluidErrorBase.ts | Added cause property declaration to IFluidErrorBase interface with ES2022 compatibility documentation |
| packages/utils/telemetry-utils/src/errorLogging.ts | Modified wrapError to set cause property and updated LoggingError to exclude cause from telemetry |
| packages/utils/telemetry-utils/src/test/errorLogging.spec.ts | Added test to verify cause property is set but not included in telemetry properties |
| .changeset/nasty-dots-dress.md | Added changeset documenting the new cause property feature |
TommyBrosman
approved these changes
Sep 19, 2025
alexvy86
approved these changes
Sep 19, 2025
anthony-murphy-agent
pushed a commit
to anthony-murphy-agent/FluidFramework
that referenced
this pull request
Jan 14, 2026
…ping errors (microsoft#25485) but do not log [`cause` property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error/cause) itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
but do not log
causeproperty itself.