From e0ddb88cb7c9d71437179d50cecb57f60cdc4c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Thu, 21 Nov 2024 11:44:56 +0100 Subject: [PATCH] push: improve error messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the error message for failure to sync the whole namespace was too long, so split it into two lines and make it a warning. the namespace creation one lacked context (that the error was caused by the remote side or the connection) and had too much (the datastore, which is already logged very often) at the same time. Signed-off-by: Fabian Grünbichler --- src/server/push.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/push.rs b/src/server/push.rs index 666900e8..9ebf8031 100644 --- a/src/server/push.rs +++ b/src/server/push.rs @@ -305,12 +305,11 @@ async fn check_or_create_target_namespace( if !parent.is_root() { args["parent"] = serde_json::to_value(parent.clone())?; } - let target_store_and_ns = print_store_and_ns(params.target.repo.store(), ¤t); match params.target.client.post(&api_path, Some(args)).await { - Ok(_) => info!("Created new namespace on target: {target_store_and_ns}"), - Err(err) => bail!( - "Sync into {target_store_and_ns} failed - namespace creation failed: {err}" - ), + Ok(_) => info!("Created new namespace on target: {current}"), + Err(err) => { + bail!("Remote creation of namespace {current} failed, remote returned: {err}") + } } parent = current; } @@ -372,7 +371,8 @@ pub(crate) async fn push_store(mut params: PushParameters) -> Result