Fix and test the standalone error backends - #269
Merged
Merged
Conversation
`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>
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.
cgp-error-eyrebuilt eyre withoutauto-install, so every report it built panicked unless the application had installed a hook first. It now enablesauto-installand leavestrack-calleroff, since the recorded location was always a line inside the backend rather than the caller.In
cgp-error-std,WrapErrorprinted its source insideDisplayand also returned it fromsource(), so a reporter walking the chain printed it twice.{}now prints the detail alone, and{:#}and{:?}print the whole chain.RaiseBoxedStdErrorgains theErrorWrapperimpl 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-eyredrops its#![no_std], since eyre requiresstd. anyhow moves to 1.0.104 and eyre to 0.6.14.The new
error_backendstarget incgp-testscovers raising and wrapping through each backend, what each provider prints, whether the source survives, wiring through the@cgp.core.errornamespace paths, the genericRaiseFromequivalence, one provider running unchanged on all three backends, and verbatim copies of the README examples.