Skip to content

feat: backport of upstream PR #3555: backport of TracedError features from upstream PR #1055#5

Merged
BatmanAoD merged 2 commits into
rigetti-mainfrom
rigetti-only-pr-3555
Jun 18, 2026
Merged

feat: backport of upstream PR #3555: backport of TracedError features from upstream PR #1055#5
BatmanAoD merged 2 commits into
rigetti-mainfrom
rigetti-only-pr-3555

Conversation

@BatmanAoD

Copy link
Copy Markdown
Collaborator

"local" version of tokio-rs#3555

yaahc and others added 2 commits June 17, 2026 14:19
## Motivation

Right now TracedError is pretty much incompatible with enum heavy error
handling implementations. The way its currently designed you'd have to make
sure that each leaf error independently is wrapped in a `TracedError` so that
all sources end up capturing a SpanTrace.

## Solution

To resolve this I've added a `map` method for transforming the inner type of a
TracedError while preserving the existing SpanTrace. This is still a bit
cumbersome, where before you'd be able to write `result.map_err(|source|
MyError { source, some_context })` now you'll have to write
`result.map_err(|source| source.map(|source| MyError { source, some_context
}))`. To fix this we should probably eventually add an extension trait on
`Result` but I want to experiment with that half of the change in `zebra`
before committing to an API, since it can easily be done out of tree.

Co-authored-by: Eliza Weisman <eliza@buoyant.io>

@windsurf-bot windsurf-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🤙

💡 To request another review, post a new comment with "/windsurf-review".

@BatmanAoD BatmanAoD merged commit 421a8f0 into rigetti-main Jun 18, 2026
49 of 53 checks passed
@BatmanAoD BatmanAoD deleted the rigetti-only-pr-3555 branch June 18, 2026 00:27
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

Successfully merging this pull request may close these issues.

4 participants