Skip to content
Myr

Link to err-derive crate

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent 63cd824 · Browse files · 2 files+42 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+42 added−0 removed

  • other:+42 added−0 removed

2 files+42 added−0 removed

modified:src/lib.rs+22 added
122 unmodified lines
123//! - A backtrace is captured and printed with the error if the underlying error124//! type does not already provide its own. In order to see backtraces, the125//! `RUST_LIB_BACKTRACE=1` environment variable must be defined.126//!127//! - Anyhow works with any error type that has an impl of `std::error::Error`,128//! including ones defined in your crate. We do not bundle a `derive(Error)`129//! macro but you can write the impls yourself or use a standalone macro like130//! [err-derive].131//!132//! [err-derive]: https://crates.io/crates/err-derive133//!134//! ```135//! # const IGNORE: &str = stringify! {136//! #[derive(Error, Debug)]137//! pub enum FormatError {138//! #[error(display = "invalid header (expected {:?}, got {:?})", expected, found)]139//! InvalidHeader {140//! expected: String,141//! found: String,142//! },143//! #[error(display = "missing attribute: {}", _0)]144//! MissingAttribute(String),145//! }146//! # };147//! ```148//!149//! <br>150//!151//! # Acknowledgements152//!
75 unmodified lines
modified:README.md+20 added