Macro clierr::ccheck [] [src]

macro_rules! ccheck {
    ($e:expr, $fmt:expr) => { ... };
    ($e:expr, $fmt:expr, $($arg:tt)*) => { ... };
}

Like assert! but instead of panicking it early-returns an Error with a given description (which can be specified using format_args! syntax).

Example:

ccheck!(value(key) == 42, "value of {} was not 42 ({})", key, value(key))

Note: If you don't like macros, the DescribeErr trait already cuts on a lot of verbosity.