Macro nes::try
[−]
[src]
macro_rules! try { ( $o:expr, $error:path ) => { ... }; ( $o:expr, $error:path, $( $arg:expr ),* ) => { ... }; }
This macro looks like standard try!() macro but it gets information where the error has been occurred.
Note: if error, that you convert to other, contains ErrorInfo(is defined by define_error!() and is not like std::io::Error), you should use ?.
# Example
let file=try!( std::fs::File::open(file_name.as_str()), ReadFileError::ReadFileError, file_name ); match try!( buf_reader.read_line(&mut line), ReadFileError::IOError ) { ... }