mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-04-28 16:46:54 +00:00
sync: push: pass full error context when returning error to job
Show the full error context when fetching the remote target namespaces fails. As logging of the error is handled by the calling sync job, reformat the error to include the error context before returning. Instead of the error ``` TASK ERROR: Fetching remote namespaces failed, remote returned error ``` the user is now presented with an error like ``` TASK ERROR: Fetching remote namespaces failed, remote returned error: datastore 'removable1' is not mounted ``` Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
parent
00ced7808b
commit
17b7ab8021
@ -3,7 +3,7 @@
|
||||
use std::collections::HashSet;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use anyhow::{bail, Context, Error};
|
||||
use anyhow::{bail, format_err, Context, Error};
|
||||
use futures::stream::{self, StreamExt, TryStreamExt};
|
||||
use tokio::sync::mpsc;
|
||||
use tokio_stream::wrappers::ReceiverStream;
|
||||
@ -379,7 +379,9 @@ pub(crate) async fn push_store(mut params: PushParameters) -> Result<SyncStats,
|
||||
source_namespaces.sort_unstable_by_key(|a| a.name_len());
|
||||
|
||||
// Fetch all accessible namespaces already present on the target
|
||||
let mut existing_target_namespaces = fetch_target_namespaces(¶ms).await?;
|
||||
let mut existing_target_namespaces = fetch_target_namespaces(¶ms)
|
||||
.await
|
||||
.map_err(|err| format_err!("{err:#}"))?;
|
||||
// Remember synced namespaces, removing non-synced ones when remove vanished flag is set
|
||||
let mut synced_namespaces = HashSet::with_capacity(source_namespaces.len());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user