eoe

Crates.ioeoe
lib.rseoe
version0.1.1
sourcesrc
created_at2024-07-09 01:46:28.573365
updated_at2024-07-14 14:37:50.111385
descriptionThis crate helps you exit on error with underlying `anyhow` error handling.
homepage
repositoryhttps://github.com/Lingxuan-Ye/eoe
max_upload_size
id1296573
size7,502
Lingxuan Ye (Lingxuan-Ye)

documentation

README

Exit on Error

Crates.io Documentation License: MIT

This crate helps you exit on error with underlying anyhow error handling.

Install

cargo add eoe

Examples

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

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

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

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

Commit count: 13

cargo fmt