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4XRBSV2TBOX3N47ZZGKE6L7P7L5AC
test:
test-features:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
test-versions:
# - uses: actions-rs/cargo@v1
# with:
# command: test
# args: --no-default-features
test-os:
name: Test Suite
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: actions-rs/cargo@v1
with:
command: test
[`eyre::EyreContext`]. For an example on how to implement a custom context
check out [`stable-eyre`] which implements a minimal custom context for
capturing backtraces on stable.
[`eyre::EyreContext`].
## Custom Contexts
The heart of this crate is it's ability to swap out the Context type to change
what information is carried alongside errors and how the end report is
formatted. This crate is meant to be used alongside companion crates that
customize its behavior. Below is a list of known custom context crates and
short summaries of what features they provide.
- [`stable-eyre`]: Switches the backtrace type from `std`'s to `backtrace-rs`'s
so that it can be captured on stable. The report format is identical to
`DefaultContext`'s report format.
- [`color-eyre`]: Captures a `backtrace::Backtrace` and a
`tracing_error::SpanTrace`. Provides a `Help` trait for attaching warnings
and suggestions to error reports. The end report is then pretty printed with
the help of [`color-backtrace`], [`color-spantrace`], and `ansi_term`. Check
out the README on [`color-eyre`] for screenshots of the report format.
- [`simple-eyre`]: A minimal `EyreContext` that captures no additional
information, for when you do not wish to capture `Backtrace`s with errors.
- [`jane-eyre`]: A custom context type that exists purely for the pun.
Currently just re-exports `color-eyre`.
[`stable-eyre`]: https://docs.rs/stable-eyre
[`stable-eyre`]: https://github.com/yaahc/stable-eyre
[`color-eyre`]: https://github.com/yaahc/color-eyre
[`jane-eyre`]: https://github.com/yaahc/jane-eyre
[`simple-eyre`]: https://github.com/yaahc/simple-eyre
[`color-spantrace`]: https://github.com/yaahc/color-spantrace
[`color-backtrace`]: https://github.com/athre0z/color-backtrace
//! This crate is a fork of [`anyhow`] by @dtolnay with a support for customized `Reports`. For
//! more details on customization checkout the docs on [`eyre::EyreContext`]. For an example on how
//! to implement a custom context check out [`stable-eyre`] which implements a minimal custom
//! context for capturing backtraces on stable.
//! This crate is a fork of [`anyhow`] by @dtolnay with a support for customized
//! `Reports`. For more details on customization checkout the docs on
//! [`eyre::EyreContext`].
//!
//! ## Custom Contexts
//!
//! The heart of this crate is it's ability to swap out the Context type to change
//! what information is carried alongside errors and how the end report is
//! formatted. This crate is meant to be used alongside companion crates that
//! customize its behavior. Below is a list of known custom context crates and
//! short summaries of what features they provide.
//!
//! - [`stable-eyre`]: Switches the backtrace type from `std`'s to `backtrace-rs`'s
//! so that it can be captured on stable. The report format is identical to
//! `DefaultContext`'s report format.
//! - [`color-eyre`]: Captures a `backtrace::Backtrace` and a
//! `tracing_error::SpanTrace`. Provides a `Help` trait for attaching warnings
//! and suggestions to error reports. The end report is then pretty printed with
//! the help of [`color-backtrace`], [`color-spantrace`], and `ansi_term`. Check
//! out the README on [`color-eyre`] for screenshots of the report format.
//! - [`simple-eyre`]: A minimal `EyreContext` that captures no additional
//! information, for when you do not wish to capture `Backtrace`s with errors.
//! - [`jane-eyre`]: A custom context type that exists purely for the pun.
//! Currently just re-exports `color-eyre`.
//!
//! [`stable_eyre`]: https://docs.rs/stable-eyre
#![doc(html_root_url = "https://docs.rs/eyre/0.4.1")]
//! [`stable-eyre`]: https://github.com/yaahc/stable-eyre
//! [`color-eyre`]: https://github.com/yaahc/color-eyre
//! [`jane-eyre`]: https://github.com/yaahc/jane-eyre
//! [`simple-eyre`]: https://github.com/yaahc/simple-eyre
//! [`color-spantrace`]: https://github.com/yaahc/color-spantrace
//! [`color-backtrace`]: https://github.com/athre0z/color-backtrace
#![doc(html_root_url = "https://docs.rs/eyre/0.4.2")]
#[test]
fn test_boxed_sources() {
let error = MyError {
source: io::Error::new(io::ErrorKind::Other, "oh no!"),
};
let error = Box::<dyn StdError + Send + Sync>::from(error);
let error: Report = eyre!(error).wrap_err("it failed");
assert_eq!("it failed", error.to_string());
assert_eq!("outer", error.source().unwrap().to_string());
assert_eq!(
"oh no!",
error.source().unwrap().source().unwrap().to_string()
);
}