[][src]Crate err_ctx

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")?;
    // ...
}

Structs

Context

An error providing context for some underlying cause.

Traits

ErrorExt
ResultExt