From 35f2707c50f47a744ebcb7f7b7f7f724b31dc055 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 20 Mar 2026 13:12:59 -0400 Subject: [PATCH] api: include underlying error in API send failure message "Failed to send request to API" swallowed the reqwest error via .context(), making connection issues impossible to diagnose. Now includes the actual error (timeout, connection refused, DNS, etc). Co-Authored-By: Claude Opus 4.6 (1M context) --- poc-agent/src/api/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poc-agent/src/api/mod.rs b/poc-agent/src/api/mod.rs index 182bd51..a3d859f 100644 --- a/poc-agent/src/api/mod.rs +++ b/poc-agent/src/api/mod.rs @@ -137,7 +137,7 @@ pub(crate) async fn send_and_check( .json(body) .send() .await - .context("Failed to send request to API")?; + .map_err(|e| anyhow::anyhow!("Failed to send request to API: {}", e))?; let status = response.status(); let elapsed = start.elapsed();