Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messages for downloading UF2s #83

Merged
merged 1 commit into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading