From 37cf03e37c5598caa008902d1dc6c480f6ec90d1 Mon Sep 17 00:00:00 2001 From: Mitchell R Date: Tue, 26 May 2026 05:33:29 +0200 Subject: [PATCH] fix(kiosk): include response body in ONVIF SOAP error messages HTTP 400 from camera gave no detail. Now includes first 500 chars of response body in error message so Axiom shows the actual SOAP fault reason. Co-Authored-By: Claude Opus 4.6 (1M context) --- kiosk/src/onvif_events.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kiosk/src/onvif_events.rs b/kiosk/src/onvif_events.rs index f9f66e9..4452db0 100644 --- a/kiosk/src/onvif_events.rs +++ b/kiosk/src/onvif_events.rs @@ -256,7 +256,10 @@ fn soap_post(url: &str, action: &str, body: &str) -> Result { .send() .map_err(|e| format!("soap: {e}"))?; if !resp.status().is_success() { - return Err(format!("soap HTTP {}", resp.status())); + let status = resp.status(); + let body = resp.text().unwrap_or_default(); + let preview: String = body.chars().take(500).collect(); + return Err(format!("soap HTTP {status}: {preview}")); } resp.text().map_err(|e| format!("soap body: {e}")) }