Skip to content

Commit

Permalink
Merge pull request #83 from tekktrik/dev/error-msgs
Browse files Browse the repository at this point in the history
Improve error messages for downloading UF2s
  • Loading branch information
tekktrik authored Dec 31, 2024
2 parents 27ef692 + ab2ffb3 commit 9379a66
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion circfirm/backend/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def download_uf2(board_id: str, version: str, language: str = "en_US") -> None:

SUCCESS = 200
if response.status_code != SUCCESS:
raise ConnectionError(f"Could not download the specified UF2 file:\n{url}")
raise ConnectionError(
f"Could not download the specified UF2 file:\n{url}\nAre the board ID, version, and language correct?"
)

uf2_file.parent.mkdir(parents=True, exist_ok=True)
with open(uf2_file, mode="wb") as uf2file:
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,6 @@ ignore = ["D213", "D203"]
[tool.pytest.ini_options]
filterwarnings = ["ignore:datetime.datetime.utcfromtimestamp():DeprecationWarning"]
addopts = [
"--ignore=tests/sandbox/circuitpython"
"--ignore=tests/sandbox/circuitpython",
"--ignore=tests/backup",
]
1 change: 1 addition & 0 deletions tests/cli/test_cli_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def test_cache_save() -> None:
"https://downloads.circuitpython.org/bin/feather_m4_express/"
"nolanguage/"
"adafruit-circuitpython-feather_m4_express-nolanguage-7.3.0.uf2\n"
"Are the board ID, version, and language correct?\n"
)


Expand Down

0 comments on commit 9379a66

Please sign in to comment.