add http_bail macro

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2020-07-29 09:28:59 +02:00
parent c4febcd773
commit 7d3ffe9b8d

View File

@ -34,3 +34,11 @@ macro_rules! http_err {
))
}};
}
/// Bail with an error generated with the `http_err!` macro.
#[macro_export]
macro_rules! http_bail {
($status:ident, $($fmt:tt)+) => {{
return Err($crate::http_err!($status, $($fmt)+));
}};
}