Skip to content

Commit

Permalink
Merge pull request #1550 from dandi/enh-assert
Browse files Browse the repository at this point in the history
download: provide description for an assertion error on attempts_allowed_or_not
  • Loading branch information
yarikoptic authored Dec 12, 2024
2 parents 38409e8 + db4c0e1 commit 3ea8c87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dandi/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,10 @@ def _download_file(
yield {"status": "error", "message": str(exc)}
return
# for clear(er) typing, here we get only with int
assert isinstance(attempts_allowed_or_not, int)
assert isinstance(attempts_allowed_or_not, int), (
f"attempts_allowed_or_not is {attempts_allowed_or_not!r} "
f"of type {type(attempts_allowed_or_not)}"
)
attempts_allowed = attempts_allowed_or_not
else:
lgr.warning("downloader logic: We should not be here!")
Expand Down

0 comments on commit 3ea8c87

Please sign in to comment.