fix(sam21): broader httpx catch + tighter test assertions

Catch httpx.RequestError so DecodingError etc. trigger the bbox fallback
instead of propagating raw. Lock the intrinsics dict shape in the
happy-path test, drop unused imports.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Adriano Dal PastroandClaude Opus 4.7 committed 2026-05-11 14:42:18 +02:00
1 parent 75da9add84
commit 0bc1e02f11
2 files changed
+6 -3

No files matched your search

+1 -1
View File
@@ -63,7 +63,7 @@ class Sam21Client:
try:
with httpx.Client(timeout=self.timeout_s) as c:
r = c.post(url, json=body)
except (httpx.ConnectError, httpx.TimeoutException, httpx.NetworkError) as e:
except httpx.RequestError as e:
raise Sam21Unavailable(f"sam21 unreachable: {e}") from e
# Try to parse the envelope even on non-2xx, because SAM21 always