mirror of
https://git.proxmox.com/git/proxmox
synced 2025-07-09 22:54:26 +00:00
http_err macro: imply format!()
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
f165dee496
commit
c4febcd773
@ -27,10 +27,10 @@ impl fmt::Display for HttpError {
|
|||||||
/// Macro to create a HttpError inside a anyhow::Error
|
/// Macro to create a HttpError inside a anyhow::Error
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! http_err {
|
macro_rules! http_err {
|
||||||
($status:ident, $msg:expr) => {{
|
($status:ident, $($fmt:tt)+) => {{
|
||||||
::anyhow::Error::from($crate::api::error::HttpError::new(
|
::anyhow::Error::from($crate::api::error::HttpError::new(
|
||||||
$crate::api::error::StatusCode::$status,
|
$crate::api::error::StatusCode::$status,
|
||||||
$msg,
|
format!($($fmt)+)
|
||||||
))
|
))
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user