Expand description
An easy way to print cause chains in errors. Simply wrap your error type in ErrorChain and debug format it.
Works great with thiserror’s #[from]!
use sausage::ErrorChain;
use std::io;
fn main_() -> Result<(), ErrorChain> {
might_fail()?;
Ok(())
}
fn might_fail() -> Result<(), io::Error> {
Err(io::Error::new(io::ErrorKind::Other, "oh noes!"))
}Structs§
- Error
Chain - Wraps an error, prints the error with all it’s
sourcess.