pull: add error context for initial group list call

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@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2021-01-15 11:48:54 +01:00 committed by Thomas Lamprecht
parent e2956c605d
commit 44de5bcc00
1 changed files with 4 additions and 1 deletions

View File

@ -570,7 +570,10 @@ pub async fn pull_store(
let path = format!("api2/json/admin/datastore/{}/groups", src_repo.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())?; let mut list: Vec<GroupListItem> = serde_json::from_value(result["data"].take())?;