By default, 'errors' is now empty.
Depend on proxmox 0.13.5.
pathpatterns = "0.1.2"
pxar = { version = "0.10.1", features = [ "tokio-io" ] }
-proxmox = { version = "0.13.4", features = [ "sortable-macro", "api-macro", "cli", "router", "tfa" ] }
+proxmox = { version = "0.13.5", features = [ "sortable-macro", "api-macro", "cli", "router", "tfa" ] }
proxmox-acme-rs = "0.2.1"
proxmox-apt = "0.7.0"
proxmox-http = { version = "0.4.0", features = [ "client", "http-helpers", "websocket" ] }
regex = "1.2"
serde = { version = "1.0", features = ["derive"] }
-proxmox = { version = "0.13.4", default-features = false, features = [ "api-macro" ] }
+proxmox = { version = "0.13.5", default-features = false, features = [ "api-macro" ] }
proxmox-systemd = { path = "../proxmox-systemd" }
pbs-tools = { path = "../pbs-tools" }
xdg = "2.2"
pathpatterns = "0.1.2"
-proxmox = { version = "0.13.4", default-features = false, features = [ "cli" ] }
+proxmox = { version = "0.13.5", default-features = false, features = [ "cli" ] }
proxmox-fuse = "0.1.1"
proxmox-http = { version = "0.4.0", features = [ "client", "http-helpers", "websocket" ] }
pxar = { version = "0.10.1", features = [ "tokio-io" ] }
regex = "1.2"
once_cell = "1.3.1"
-proxmox = { version = "0.13.4", default-features = false, features = [ "cli" ] }
+proxmox = { version = "0.13.5", default-features = false, features = [ "cli" ] }
pbs-api-types = { path = "../pbs-api-types" }
pbs-buildcfg = { path = "../pbs-buildcfg" }
pathpatterns = "0.1.2"
pxar = "0.10.1"
-proxmox = { version = "0.13.4", default-features = false, features = [ "api-macro" ] }
+proxmox = { version = "0.13.5", default-features = false, features = [ "api-macro" ] }
pbs-api-types = { path = "../pbs-api-types" }
pbs-tools = { path = "../pbs-tools" }
regex = "1.2"
tokio = { version = "1.6", features = [] }
-proxmox = "0.13.4"
+proxmox = "0.13.5"
proxmox-fuse = "0.1.1"
pbs-tools = { path = "../pbs-tools" }
regex = "1.2"
udev = ">= 0.3, <0.5"
-proxmox = { version = "0.13.4", default-features = false, features = [] }
+proxmox = { version = "0.13.5", default-features = false, features = [] }
pbs-api-types = { path = "../pbs-api-types" }
pbs-tools = { path = "../pbs-tools" }
walkdir = "2"
zstd = { version = "0.6", features = [ "bindgen" ] }
-proxmox = { version = "0.13.4", default-features = false, features = [ "tokio" ] }
+proxmox = { version = "0.13.5", default-features = false, features = [ "tokio" ] }
pbs-buildcfg = { path = "../pbs-buildcfg" }
pbs-runtime = { path = "../pbs-runtime" }
pathpatterns = "0.1.2"
pxar = { version = "0.10.1", features = [ "tokio-io" ] }
-proxmox = { version = "0.13.4", features = [ "sortable-macro", "api-macro", "cli", "router" ] }
+proxmox = { version = "0.13.5", features = [ "sortable-macro", "api-macro", "cli", "router" ] }
pbs-api-types = { path = "../pbs-api-types" }
pbs-buildcfg = { path = "../pbs-buildcfg" }
pxar = { version = "0.10.1", features = [ "tokio-io" ] }
-proxmox = { version = "0.13.4", features = [ "api-macro", "cli" ] }
+proxmox = { version = "0.13.5", features = [ "api-macro", "cli" ] }
pbs-api-types = { path = "../pbs-api-types" }
pbs-buildcfg = { path = "../pbs-buildcfg" }
tower-service = "0.3.0"
url = "2.1"
-proxmox = { version = "0.13.4", features = [ "router"] }
+proxmox = { version = "0.13.5", features = [ "router"] }
# fixme: remove this dependency (pbs_tools::broadcast_future)
pbs-tools = { path = "../pbs-tools" }
use hyper::{Body, Response, StatusCode};
use hyper::header;
-use proxmox::api::{HttpError, RpcEnvironment};
+use proxmox::api::{HttpError, schema::ParameterError, RpcEnvironment};
/// Extension to set error message for server side logging
pub(crate) struct ErrorMessageExtension(pub String);
/// Format data as ``application/json``
///
+/// The returned json object contains the following properties:
+///
+/// * ``data``: The result data (on success)
+///
+/// Any result attributes set on ``rpcenv`` are also added to the object.
+///
/// Errors generates a BAD_REQUEST containing the error
/// message as string.
pub static JSON_FORMATTER: &'static dyn OutputFormatter = &JsonFormatter();
fn format_error(&self, err: Error) -> Response<Body> {
- let mut errors = vec![];
+ let message: String;
+ let errors;
- let message = err.to_string();
- errors.push(&message);
+ if let Some(param_err) = err.downcast_ref::<ParameterError>() {
+ errors = param_err.errors().iter()
+ .map(|(name, err)| format!("parameter '{}': {}", name, err))
+ .collect();
+ message = String::from("parameter verification errors");
+ } else {
+ errors = vec![];
+ message = err.to_string();
+ }
let result = json!({
"message": message,
pathpatterns = "0.1.2"
pxar = { version = "0.10.1", features = [ "tokio-io" ] }
-proxmox = { version = "0.13.4", features = [ "router", "sortable-macro" ] }
+proxmox = { version = "0.13.5", features = [ "router", "sortable-macro" ] }
pbs-api-types = { path = "../pbs-api-types" }
pbs-runtime = { path = "../pbs-runtime" }
lazy_static = "1.4"
nom = "5.1"
-proxmox = { version = "0.13.4", default-features = false }
+proxmox = { version = "0.13.5", default-features = false }
#pbs-tools = { path = "../pbs-tools" }
tokio = { version = "1.6", features = [ "rt", "rt-multi-thread" ] }
pathpatterns = "0.1.2"
-proxmox = { version = "0.13.4", default-features = false, features = [] }
+proxmox = { version = "0.13.5", default-features = false, features = [] }
pxar = { version = "0.10.1", features = [ "tokio-io" ] }
pbs-client = { path = "../pbs-client" }