macro_rules! frame_error {
($code:expr, $message:expr) => { ... };
}Expand description
Shorthand for making errors with error code and error message.
use ironmq_codec::frame_error;
use ironmq_codec::FrameError;
use ironmq_codec::frame::AMQPValue;
fn as_string(val: AMQPValue) -> Result<String, Box<dyn std::error::Error>> {
if let AMQPValue::SimpleString(s) = val {
return Ok(s.clone())
}
frame_error!(10, "Value cannot be converted to string")
}