Skip to content

Commit

Permalink
Handle flawed input to zino log parser
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed Jan 25, 2024
1 parent e5a4920 commit 82a0995
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/zinolib/controllers/zino1.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,11 @@ def parse_response(log_data: Iterable[str]) -> list[LogDict]:
log_list: List[LogDict] = []
for row in log_data:
timestamp, log = row.split(" ", 1)
dt = convert_timestamp(int(timestamp))
try:
timestamp = int(timestamp)
except ValueError as e:
raise RetryError('Zino 1 is flaking out, retry') from e

Check warning on line 403 in src/zinolib/controllers/zino1.py

View check run for this annotation

Codecov / codecov/patch

src/zinolib/controllers/zino1.py#L402-L403

Added lines #L402 - L403 were not covered by tests
dt = convert_timestamp(timestamp)
log_list.append({"date": dt, "log": log})
return log_list

Expand Down

0 comments on commit 82a0995

Please sign in to comment.