fn-error-context

Crates.iofn-error-context
lib.rsfn-error-context
version0.2.1
sourcesrc
created_at2020-03-29 16:38:36.093552
updated_at2023-03-21 00:02:02.379391
descriptionAn attribute macro to add context to errors from a function.
homepage
repositoryhttps://github.com/andrewhickman/fn-error-context
max_upload_size
id224120
size39,955
Andrew Hickman (andrewhickman)

documentation

https://docs.rs/fn-error-context

README

Crates.io Docs.rs

fn-error-context

An attribute macro to add context to errors from a function.

#[context("failed to parse config at `{}`", path.display())]
pub fn parse_config(path: &Path) -> anyhow::Result<u32> {
    let text = read_to_string(path)?;
    Ok(text.parse()?)
}
Commit count: 34

cargo fmt