delete upon failing to decode JSON from sd blob
This commit is contained in:
parent
edb5083a5e
commit
fcdd9295b4
1 changed files with 1 additions and 0 deletions
|
@ -134,6 +134,7 @@ class StreamDescriptor:
|
||||||
try:
|
try:
|
||||||
decoded = json.loads(json_bytes.decode())
|
decoded = json.loads(json_bytes.decode())
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
|
blob.delete()
|
||||||
raise InvalidStreamDescriptorError("Does not decode as valid JSON")
|
raise InvalidStreamDescriptorError("Does not decode as valid JSON")
|
||||||
if decoded['blobs'][-1]['length'] != 0:
|
if decoded['blobs'][-1]['length'] != 0:
|
||||||
raise InvalidStreamDescriptorError("Does not end with a zero-length blob.")
|
raise InvalidStreamDescriptorError("Does not end with a zero-length blob.")
|
||||||
|
|
Loading…
Reference in a new issue