err-ctx 0.2.1

Contextual error reporting helpers
Documentation

Minimalist helper library for providing contextual errors that display in the traditional "context: cause" format. Useful for applications where the primary goal is to convey detailed diagnostics to a user.

use std::{fs, error::Error};
use err_ctx::ResultExt;
fn run() -> Result<(), Box<Error>> {
    // An error here might display as "reading foo.txt: No such file or directory"
    let data = fs::read("foo.txt").ctx("reading foo.txt")?;
    // ...
#     Ok(())
}