thiserror
thiserror copied to clipboard
derive(Error) for struct and enum error types
Hi, Using backtrace captures, I'm trying to figure out how to use libraries like color-backtrace (which needs backtrace::Backtrace from `backtrace-rs`). Looks like std::backtrace functionality is still guarded with a lot...
The crate I'm currently working on has code like the following: ```rust #[derive(Debug, Clone, Error)] pub struct Error { pub(crate) kind: ErrorKind, backtrack: Option, } #[derive(Debug, Error)] pub enum ErrorKind...
Thanks for this crate :). I use it all the time and even switched from `quick-error` to it because it seemed to have no real disadvantages. My problem is probably...
Hi @dtolnay, that you so much for this awesome crate. I use it everywhere all the time (together with `anyhow`). Was trying to figure out how to nicely display an...
Hey folks, There is an issue that took me a while to understand, and it's that in the lib doc is not very clear how to display the error that...
Migrating from `failure` to `anyhow`, I encounter an issue where I start losing backtraces when `anyhow::Error`s are wrapped in another error type: ```rust #[test] fn backtrace_preserved_after_thiserror_derive() { #[derive(Debug, thiserror::Error)] pub...
Hi, I discovered a little strange behavior when using the experimental backtrace api together with thiserror. I have prepared an example [gist](https://gist.github.com/rust-play/28fa7cbd18b08560e61c28ca02ee4bb4) and the [playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=ca3d64f6ba5a40a4a912a6746cae4441) You get different behavior when...
I have an error enum that I want to convert from snafu to thiserror with the following case: ```rust #[error("Error serializing type {source}: {msg}")] SerializeErr { /// the source type...
I recently cooked up https://github.com/CraneStation/wasmtime/pull/532 which fixed a "double error message" getting printed for errors such as: ```rust pub enum CompileError { #[error("WebAssembly translation error: {0}")] Wasm(#[from] WasmError), } ```...
I think it'd be immensely useful if `iter_chain` can be added on the type that derives Error and delegated to std::error::Error's iter_chain on nightlies with `error_iter` feature. Sure, one can...