Macro clierr::ctry [] [src]

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

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).

Example:

ctry!(File::open(filename), "could not open output file {}", filename)

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