macro_rules! pass_try {
($base:expr, $scope:expr, $res:expr $(,)?) => { ... };
}
Expand description
Handles the error case in an expression of type Result<T, E>
.
This macro operates like the ?
operator (or, in early Rust versions, the
try!
macro, hence the name pass_try
). When there is an error, the
macro returns from the invoking function. However, Ok(())
, and not the
error itself, is returned. The error is stored in the pass and will later be
transferred to the parent encoder when the pass ends, and then raised as a
validation error when finish()
is called for the parent.
pass_try!
also calls MapPassErr::map_pass_err
to annotate the error
with the command being encoded at the time it occurred.