Macro titanic::try_err[][src]

macro_rules! try_err {
    ($expr:expr) => { ... };
}

Like the try! macro only that this returns Some(Err(err)) instead of Err(err).

This example is not tested
assert_eq!(try_err!(Ok(1)), try!(Ok(1)));
assert!(try_err!(Err("some error"))) // returns Some(Err("some error"))