errors 0.1.0

std::error::Error utilities
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
type E = Box<dyn std::error::Error + Send + Sync>;

fn main() -> Result<(), errors::Main> {
    one()?;
    Ok(())
}

fn one() -> Result<(), E> {
    println!("> one");
    two().map_err(|e| errors::wrap("two failed", e))?;
    println!("< one");
    Ok(())
}

fn two() -> Result<(), E> {
    println!("> two");
    Err(errors::new("kaboom").into())
}