Handle a bad batch

This commit is contained in:
Daoud Clarke 2023-04-01 06:35:44 +01:00
parent e9dfd40ecb
commit 91269d5100

View file

@ -39,7 +39,11 @@ class BatchCache:
except FileNotFoundError:
logger.exception(f"Missing batch file: {path}")
continue
batch = HashedBatch.parse_raw(data)
try:
batch = HashedBatch.parse_raw(data)
except ValidationError:
logger.exception(f"Unable to parse batch, skipping: '{data}'")
continue
batches[url] = batch
return batches