From 8cabe37818a67d560cce95f7f4bed7f6e8e50c95 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Wed, 15 Jul 2026 02:34:22 +0530 Subject: [PATCH] fix(contracts): log the full B2 upload error chain, not just outer context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tracing::error!("...: {}", e) on an anyhow::Error only prints the outermost .context() message ("B2 upload failed") — the actual root cause (auth failure, DNS, timeout, bad bucket, etc.) from the AWS SDK is swallowed. Switching to {:?} prints the full chain so the real failure is visible in logs instead of a message that just repeats itself. Co-Authored-By: Claude Sonnet 5 --- crates/contracts/src/profession_shared.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/contracts/src/profession_shared.rs b/crates/contracts/src/profession_shared.rs index 75d7b7e..2d3ceaf 100644 --- a/crates/contracts/src/profession_shared.rs +++ b/crates/contracts/src/profession_shared.rs @@ -887,7 +887,10 @@ async fn upload_document( { Ok(url) => url, Err(e) => { - tracing::error!("B2 upload failed: {}", e); + // {:?} on an anyhow::Error prints the full context chain, not just + // the outermost ".context()" message — that's what actually names + // the root cause (auth, DNS, timeout, etc.). + tracing::error!("B2 upload failed: {:?}", e); return (StatusCode::INTERNAL_SERVER_ERROR, Json(serde_json::json!({ "error": "File upload failed" }))).into_response(); } };