Skip to content

Bulk asynchronous downloader for multiple file hosts

fix: handle errors decoding empty strings (json)

NTFSvolume4c9d09c1fb53
diff --git a/cyberdrop_dl/utils/json.py b/cyberdrop_dl/utils/json.py
index c2dde6385..765f0ba8a 100644
--- a/cyberdrop_dl/utils/json.py
+++ b/cyberdrop_dl/utils/json.py
@@ -85,6 +85,8 @@ def _verbose_context() -> Generator[None]:
yield
except json.JSONDecodeError as e:
sub_string = e.doc[e.pos - 10 : e.pos + 10]
+ if not sub_string:
+ raise
msg = f"{e.msg} at around '{sub_string}', char: '{e.doc[e.pos]}'"
raise json.JSONDecodeError(msg, e.doc, e.pos) from None