mirror of
https://github.com/BetterCorp/BetterFrame.git
synced 2026-05-26 20:16:35 +00:00
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) <noreply@anthropic.com>
This commit is contained in:
parent
c51d971819
commit
37cf03e37c
1 changed files with 4 additions and 1 deletions
|
|
@ -256,7 +256,10 @@ fn soap_post(url: &str, action: &str, body: &str) -> Result<String, String> {
|
||||||
.send()
|
.send()
|
||||||
.map_err(|e| format!("soap: {e}"))?;
|
.map_err(|e| format!("soap: {e}"))?;
|
||||||
if !resp.status().is_success() {
|
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}"))
|
resp.text().map_err(|e| format!("soap body: {e}"))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue