Skip to content

Commit

Permalink
Dedup log message
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Dec 11, 2023
1 parent d7cb4e9 commit e52d054
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions dandi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,15 +852,11 @@ def post_upload_size_check(path: Path, pre_check_size: int, erroring: bool) -> N
# More checks for NFS flakiness
size = path.stat().st_size
if size != pre_check_size:
msg = (

Check warning on line 855 in dandi/utils.py

View check run for this annotation

Codecov / codecov/patch

dandi/utils.py#L855

Added line #L855 was not covered by tests
f"Size of {path} was {pre_check_size} at start of upload but is"
f" now {size} after upload"
)
if erroring:
lgr.error(
"Size of %s was %d at start of upload but is now %d after upload",
path,
pre_check_size,
size,
)
lgr.error(msg)

Check warning on line 860 in dandi/utils.py

View check run for this annotation

Codecov / codecov/patch

dandi/utils.py#L859-L860

Added lines #L859 - L860 were not covered by tests
else:
raise RuntimeError(
f"Size of {path} was {pre_check_size} at start of upload but is"
f" now {size} after upload"
)
raise RuntimeError(msg)

Check warning on line 862 in dandi/utils.py

View check run for this annotation

Codecov / codecov/patch

dandi/utils.py#L862

Added line #L862 was not covered by tests

0 comments on commit e52d054

Please sign in to comment.