Skip to content

Commit

Permalink
Merge pull request #364 from OpenTrafficCam/feature/log-path-when-fai…
Browse files Browse the repository at this point in the history
…ling-to-read-json

Logging path when failing to read json
  • Loading branch information
briemla authored Sep 12, 2024
2 parents 1291745 + 365f080 commit 1dbb5c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion OTVision/helpers/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ def metadata_from_json_events(parse_events: Iterable[tuple[str, str, str]]) -> d


def read_json_bz2_metadata(path: Path) -> dict:
return metadata_from_json_events(read_json_bz2_event_stream(path))
try:
return metadata_from_json_events(read_json_bz2_event_stream(path))
except EOFError as cause:
log.exception(f'Unable to read "{path}" as JSON.', exc_info=cause)
raise cause


def read_json(
Expand Down

0 comments on commit 1dbb5c7

Please sign in to comment.