easyerr_derive 0.1.0

derive macro for the easyerr crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use easyerr::*;

#[derive(Debug, Error)]
enum TestError {
    #[error(transparent)]
    Foo { source: std::io::Error, a: u64 },
    #[error("something went terribly wrong!")]
    Bar,
    #[error("stringy {f0}")]
    Baz(String),
}

fn main() {
    let _e = Err::<(), _>(std::io::Error::new(std::io::ErrorKind::NotFound, "oops"))
        .context(TestCtx::Foo { a: 0 });
}