Macro axerrno::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,
);