From 17b7ab80213199264ffcc8d478bcdf71291e1c4a Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Wed, 27 Nov 2024 10:26:53 +0100 Subject: [PATCH] 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 --- 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 99757a3c..74bc29e7 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