]> git.proxmox.com Git - proxmox.git/commitdiff
http_err macro: imply format!()
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 29 Jul 2020 07:25:46 +0000 (09:25 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 29 Jul 2020 07:26:22 +0000 (09:26 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox/src/api/error.rs

index 221dcf77eca6e4a253f9d9999d2a20f90a5a37e5..d152a25070ee69d82fb874010f227f6d75c11689 100644 (file)
@@ -27,10 +27,10 @@ impl fmt::Display for HttpError {
 /// Macro to create a HttpError inside a anyhow::Error
 #[macro_export]
 macro_rules! http_err {
-    ($status:ident, $msg:expr) => {{
+    ($status:ident, $($fmt:tt)+) => {{
         ::anyhow::Error::from($crate::api::error::HttpError::new(
             $crate::api::error::StatusCode::$status,
-            $msg,
+            format!($($fmt)+)
         ))
     }};
 }