Skip to main content

ax_err_type

Macro ax_err_type 

Source
macro_rules! ax_err_type {
    ($err:ident) => { ... };
    ($err:ident, $msg:expr) => { ... };
}
Expand description

Convenience method to construct an AxError type while printing a warning message.

ยงExamples

// Also print "[AxError::AlreadyExists]" if the `log` crate is enabled.
assert_eq!(ax_err_type!(AlreadyExists), AxError::AlreadyExists,);

// Also print "[AxError::BadAddress] the address is 0!" if the `log` crate
// is enabled.
assert_eq!(
    ax_err_type!(BadAddress, "the address is 0!"),
    AxError::BadAddress,
);