Skip to content

Fix and test the standalone error backends - #269

Merged
soareschen merged 2 commits into
mainfrom
error-refactoring
Sep 26, 2026
Merged

soareschen merged 2 commits into
mainfrom
error-refactoring

Conversation

@soareschen

Copy link
Copy Markdown
Collaborator

cgp-error-eyre built eyre without auto-install, so every report it built panicked unless the application had installed a hook first. It now enables auto-install and leaves track-caller off, since the recorded location was always a line inside the backend rather than the caller.

In cgp-error-std, WrapError printed its source inside Display and also returned it from source(), so a reporter walking the chain printed it twice. {} now prints the detail alone, and {:#} and {:?} print the whole chain. RaiseBoxedStdError gains the ErrorWrapper impl that the anyhow and eyre raisers already had.

Every provider is rewritten with #[cgp_impl] and the equality form of #[use_type], and gets a /// comment. Each crate gains a README that serves as its docs.rs front page, and cleaned-up package metadata. cgp-error-eyre drops its #![no_std], since eyre requires std. anyhow moves to 1.0.104 and eyre to 0.6.14.

The new error_backends target in cgp-tests covers raising and wrapping through each backend, what each provider prints, whether the source survives, wiring through the @cgp.core.error namespace paths, the generic RaiseFrom equivalence, one provider running unchanged on all three backends, and verbatim copies of the README examples.

soareschen and others added 2 commits September 26, 2026 14:23
`cgp-error-eyre` built eyre without `auto-install`, so every report it
built panicked unless the application had installed a hook first. It now
enables `auto-install` and leaves `track-caller` off, since the recorded
location was always a line inside the backend rather than the caller.

In `cgp-error-std`, `WrapError` printed its source inside `Display` and
also returned it from `source()`, so a reporter walking the chain printed
it twice. `{}` now prints the detail alone, and `{:#}` and `{:?}` print
the whole chain. `RaiseBoxedStdError` gains the `ErrorWrapper` impl that
the anyhow and eyre raisers already had.

Every provider is rewritten with `#[cgp_impl]` and the equality form of
`#[use_type]`, and gets a `///` comment. Each crate gains a README that
serves as its docs.rs front page, and cleaned-up package metadata.
`cgp-error-eyre` drops its `#![no_std]`, since eyre requires `std`.
anyhow moves to 1.0.104 and eyre to 0.6.14.

The new `error_backends` target in `cgp-tests` covers raising and
wrapping through each backend, what each provider prints, whether the
source survives, wiring through the `@cgp.core.error` namespace paths,
the generic `RaiseFrom` equivalence, one provider running unchanged on
all three backends, and verbatim copies of the README examples.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eyre's default handler appends a backtrace to a report's `{:?}` output
when `RUST_BACKTRACE` or `RUST_LIB_BACKTRACE` is set, so the exact match
failed in any environment with either variable set. Check that the
output starts with the chain and has no `Location:` section instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@soareschen
soareschen merged commit adc616c into main Sep 26, 2026
3 checks passed
@soareschen
soareschen deleted the error-refactoring branch September 26, 2026 14:32
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.

1 participant