From 44de5bcc00bf3474a0479cd144a9e75e8d16da30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Fri, 15 Jan 2021 11:48:54 +0100 Subject: [PATCH] pull: add error context for initial group list call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit otherwise the user is confronted with a generic error like "permission check failed" with no indication that it refers to a request made to the remote PBS instance.. Signed-off-by: Fabian Grünbichler --- src/client/pull.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/pull.rs b/src/client/pull.rs index f6ef7cde..15514374 100644 --- a/src/client/pull.rs +++ b/src/client/pull.rs @@ -570,7 +570,10 @@ pub async fn pull_store( let path = format!("api2/json/admin/datastore/{}/groups", src_repo.store()); - let mut result = client.get(&path, None).await?; + let mut result = client + .get(&path, None) + .await + .map_err(|err| format_err!("Failed to retrieve backup groups from remote - {}", err))?; let mut list: Vec = serde_json::from_value(result["data"].take())?;