diff --git a/proxmox-rest-server/Cargo.toml b/proxmox-rest-server/Cargo.toml index aea55f13..8fbbe8c0 100644 --- a/proxmox-rest-server/Cargo.toml +++ b/proxmox-rest-server/Cargo.toml @@ -7,7 +7,7 @@ description = "REST server implementation" # for example [dev-dependencies] -proxmox-schema = { version = "1.1", features = [ "api-macro" ] } +proxmox-schema = { version = "1.2", features = [ "api-macro" ] } tokio = { version = "1.6", features = [ "rt-multi-thread", "signal", "process" ] } [dependencies] @@ -36,6 +36,6 @@ proxmox-io = "1" proxmox-lang = "1" proxmox-http = { version = "0.6", features = [ "client" ] } proxmox-router = "1.1" -proxmox-schema = { version = "1.1", features = [ "api-macro", "upid-api-impl" ] } +proxmox-schema = { version = "1.2", features = [ "api-macro", "upid-api-impl" ] } proxmox-time = "1" proxmox-sys = "0.2" diff --git a/proxmox-rest-server/src/formatter.rs b/proxmox-rest-server/src/formatter.rs index cb5774d5..e3958826 100644 --- a/proxmox-rest-server/src/formatter.rs +++ b/proxmox-rest-server/src/formatter.rs @@ -147,13 +147,14 @@ impl OutputFormatter for ExtJsFormatter { let message: String; let mut errors = HashMap::new(); - if let Some(param_err) = err.downcast_ref::() { - for (name, err) in param_err.errors().iter() { - errors.insert(name, err.to_string()); + match err.downcast::() { + Ok(param_err) => { + for (name, err) in param_err { + errors.insert(name, err.to_string()); + } + message = String::from("parameter verification errors"); } - message = String::from("parameter verification errors"); - } else { - message = err.to_string(); + Err(err) => message = err.to_string(), } let result = json!({