* [pbs-devel] [PATCH proxmox-backup] sync: push: pass full error context when returning error to job
@ 2024-11-27 9:26 Christian Ebner
2024-11-27 11:39 ` [pbs-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Christian Ebner @ 2024-11-27 9:26 UTC (permalink / raw)
To: pbs-devel
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>
---
src/server/push.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/server/push.rs b/src/server/push.rs
index 99757a3cc..74bc29e7e 100644
--- a/src/server/push.rs
+++ b/src/server/push.rs
@@ -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());
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pbs-devel] applied: [PATCH proxmox-backup] sync: push: pass full error context when returning error to job
2024-11-27 9:26 [pbs-devel] [PATCH proxmox-backup] sync: push: pass full error context when returning error to job Christian Ebner
@ 2024-11-27 11:39 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2024-11-27 11:39 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Christian Ebner
Am 27.11.24 um 10:26 schrieb Christian Ebner:
> 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>
> ---
> src/server/push.rs | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>
applied, thanks!
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-27 11:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-27 9:26 [pbs-devel] [PATCH proxmox-backup] sync: push: pass full error context when returning error to job Christian Ebner
2024-11-27 11:39 ` [pbs-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox