Crate clierr

Source
Expand description

A small library which provides convenient, non-panicking error handling for small CLI scripts.

Macros§

ccheck
Like assert! but instead of panicking it early-returns an Error with a given description (which can be specified using format_args! syntax).
ctry
Like try!, but in the error case the error is wrapped in an Error with a given description (which can be specified using format_args! syntax).

Structs§

Error
A minimalist error type to use in CLI scripts: it wraps an arbitrary cause which implements std::error::Error and a description for the Display implementation.

Traits§

DescribeErr
A trait which enables adding a description to any Result by wrapping its error type in an Error

Functions§

run_and_exit
Runs a Result-returning function and exits the process with 0 if successful.