api/moebooru: narrow JSON parse except to ValueError

This commit is contained in:
pax 2026-04-17 20:15:48 -05:00
parent cd688be893
commit 21ac77ab7b

View File

@ -28,7 +28,7 @@ class MoebooruClient(BooruClient):
resp.raise_for_status() resp.raise_for_status()
try: try:
data = resp.json() data = resp.json()
except Exception as e: except ValueError as e:
log.warning("Moebooru search JSON parse failed: %s: %s — body: %s", log.warning("Moebooru search JSON parse failed: %s: %s — body: %s",
type(e).__name__, e, resp.text[:200]) type(e).__name__, e, resp.text[:200])
return [] return []