anyhow
anyhow copied to clipboard
Flexible concrete Error type built on std::error::Error
With Rust 1.61.0 out, the [`Termination`](https://doc.rust-lang.org/stable/std/process/trait.Termination.html) trait and associated [`ExitCode`](https://doc.rust-lang.org/stable/std/process/struct.ExitCode.html) are now stable. In the past, I maintained a large error enum purely to decipher what error code to return,...
Apologies if I am misunderstanding horribly, but `anyhow::Error` appears to violate the understanding that `{:?}` should use the Debug representation, and instead uses the Display representation of the inner error,...
Anyhow seems to have include two backtrace strategies: one for stable and one for nightly. The former is managed by default-off Cargo feature "backtrace", but the latter is turned on...
``` #![feature(backtrace)] use anyhow; use thiserror::Error; #[derive(Error, Debug)] enum Gus { #[error("hmm")] Other( #[from] #[backtrace] anyhow::Error, ), } fn main() { use std::error::Error; use std::ops::Deref; println!("{:?}", Gus::from(anyhow::anyhow!("main"))); println!("{:?}", Gus::from(anyhow::anyhow!("main")).backtrace()); println!("{:?}",...
`-Zallow-features` makes it possible to restrict which unstable features are used. Anyhow uses the backtrace feature if it detects it to be available. This check uses `CARGO_ENCODED_RUSTFLAGS` which contains the...
Hello I've noticed there's a (closed) issue about having a `From` impl, that refers to wanting that from `std` (#66) But would it make sense to have an explicit constructor...
We've been using anyhow extensively, and it's worked out great. There's just one super confusing thing. I would expect: ``` println!("{}", anyhow!("My error message").context("on a file")) ``` To print at...
I have a function that expects `impl Error + Send + Sync + 'static`: ```rust fn a(_: impl std::error::Error + Send + Sync + 'static) { todo!() } ``` I...
First off, thank you for this wonderful library! ### Context It's often difficult to find where in your code an error occurred. Rust's backtraces help with this, but are often...