Skip to content

feat: 'impl Clone' and inner-error access for TracedError#1

Merged
BatmanAoD merged 4 commits into
rigetti-mainfrom
traced-error-improvements
Jun 18, 2026
Merged

feat: 'impl Clone' and inner-error access for TracedError#1
BatmanAoD merged 4 commits into
rigetti-mainfrom
traced-error-improvements

Conversation

@BatmanAoD

@BatmanAoD BatmanAoD commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Our "local" version of tokio-rs#3556.

Remainder of motivation and solution copied from kalzoo#1

Motivation

This change makes TracedError a two-way door, making it easier to adopt in a larger codebase.

This change provides an "escape hatch" to be able to read and
extract error stored within a TracedError. Among other things,
this will help adoption of TracedError by:

  • allowing onboarding users to still match against error variants,
    as might be common in test cases

  • allowing crate users to bypass missing or unreleased features

  • allowing for partial migration of a codebase, so that TracedError
    can be used in one portion, and then the original error extracted
    at some interface above which TracedError is not yet used or wanted.

Solution

Add TracedError::get_inner_error to get a ref, and TracedError::to_inner_error to unwrap it entirely

@BatmanAoD BatmanAoD marked this pull request as ready for review May 29, 2026 23:49

@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 force-pushed the pr-1055-traced-error-err-into branch from ddd8a61 to acbbf51 Compare June 16, 2026 05:01
@BatmanAoD BatmanAoD force-pushed the traced-error-improvements branch 2 times, most recently from dab96a0 to e6c1bbf Compare June 17, 2026 00:30
@BatmanAoD BatmanAoD force-pushed the pr-1055-traced-error-err-into branch from acbbf51 to 635c708 Compare June 17, 2026 00:30
@BatmanAoD BatmanAoD force-pushed the traced-error-improvements branch from e6c1bbf to 3b3df65 Compare June 17, 2026 00:35
@BatmanAoD BatmanAoD force-pushed the pr-1055-traced-error-err-into branch from a2cd246 to 979cc0e Compare June 17, 2026 00:42
@BatmanAoD BatmanAoD force-pushed the traced-error-improvements branch 2 times, most recently from 6230cfc to ef87fd7 Compare June 17, 2026 15:08
@BatmanAoD BatmanAoD force-pushed the pr-1055-traced-error-err-into branch from 979cc0e to ade769c Compare June 17, 2026 15:08
@BatmanAoD BatmanAoD force-pushed the traced-error-improvements branch from ef87fd7 to 0729770 Compare June 17, 2026 20:23
@BatmanAoD BatmanAoD changed the base branch from pr-1055-traced-error-err-into to rigetti-only-pr-3555 June 17, 2026 20:28
Base automatically changed from rigetti-only-pr-3555 to rigetti-main June 18, 2026 00:27
kalzoo and others added 4 commits June 17, 2026 18:45
This change makes TracedError a two-way door, making it
easier to adopt in a larger codebase.

This change provides an "escape hatch" to be able to read and
extract error stored within a TracedError. Among other things,
this will help adoption of TracedError by:

* allowing onboarding users to still match against error variants,
  as might be common in test cases

* allowing crate users to bypass missing or unreleased features

* allowing for partial migration of a codebase, so that TracedError
  can be used in one portion, and then the original error extracted
  at some interface above which TracedError is not yet used or wanted.
@BatmanAoD BatmanAoD force-pushed the traced-error-improvements branch from 0729770 to fb8f983 Compare June 18, 2026 00:45
@BatmanAoD BatmanAoD merged commit 0a8abda into rigetti-main Jun 18, 2026
49 of 53 checks passed
@BatmanAoD BatmanAoD deleted the traced-error-improvements branch June 18, 2026 17:58
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.

3 participants