[pbs-devel] [PATCH proxmox-backup 2/3] pull: add error context for initial group list call

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Jan 15 11:48:54 CET 2021


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 <f.gruenbichler at proxmox.com>
---
 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<GroupListItem> = serde_json::from_value(result["data"].take())?;
 
-- 
2.20.1






More information about the pbs-devel mailing list