Macro trackable::track_try [] [src]

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

Error trackable variant of the standard try! macro.

Conceptually, track_try!(expr) is equivalent to the following code:

expr.map_err(|e| {
    // Converts to a trackable error.
    let e = trackable::error::TrackableError::from_cause(e);

    // Saves this location in the history of `e`.
    track!(e)
})?;

Like trace! macro, it is also possible to leave a message in this location:

let arg = 0;
track_try!(try_something(arg), "Failed; The value of `arg` was {:?}", arg);