Skip to content

Commit

Permalink
process.py: Catch JSON parsing error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed (ODSC) committed Oct 22, 2024
1 parent bb3022d commit 2db6fce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cove_bods/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,10 @@ def process(self, process_data: dict) -> dict:
process_data["json_data_filename"], sample_mode=process_data['sample_mode']
)
process_data['config'] = LibCoveBODSConfig()
process_data['schema'] = SchemaBODS(process_data['data_reader'], process_data['config'])
try:
process_data['schema'] = SchemaBODS(process_data['data_reader'], process_data['config'])
except json.decoder.JSONDecodeError:
raise ValueError("JSON: Data parsing error")
logger.info("Schema version:", process_data['schema'].schema_version)
# Save some to disk for templates
if not os.path.exists(self.data_filename):
Expand Down

0 comments on commit 2db6fce

Please sign in to comment.