anyhow-auto-context 1.0.0

Automatic context for anyhow errors based on scope and location
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Using with `Result`
use anyhow::Result;
use anyhow_auto_context::auto_context;

fn main() -> Result<()> {
    auto_context!(foo())
}

fn foo() -> Result<()> {
    auto_context!(bar())
}

fn bar() -> Result<()> {
    anyhow::bail!("my error")
}