api/moebooru: narrow JSON parse except to ValueError
This commit is contained in:
parent
cd688be893
commit
21ac77ab7b
@ -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 []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user