eoe 0.2.0

This crate provides utilities for exiting processes on errors gracefully.
Documentation

Exit on Error

Crates.io Documentation License: MIT

This crate provides utilities for exiting processes on errors gracefully, leveraging anyhow to display detailed error context and chained messages.

It is recommended to use the re-exported version of anyhow to avoid potential version conflicts.

Install

cargo add eoe

Examples

use eoe::ExitOnError;
use eoe::anyhow::{Context, anyhow};

Err::<(), _>(anyhow!("Mm-noom-ba-deh"))
    .context("Doom-boom-ba-beh")
    .context("Doo-boo-boom-ba-beh-beh")
    .exit_on_error();

use eoe::QuitOnError;
use eoe::anyhow::{Context, anyhow};

Err::<(), _>(anyhow!("Mm-ba-ba-beh, mm-ba-ba-beh"))
    .context("Dee-day-da, ee-day-da")
    .quit_on_error();