Skip to content
Commit 7f1a6393 authored by Noah Pendleton's avatar Noah Pendleton Committed by Benjamin Cabé
Browse files

west: blobs: fetch exit immediately on HTTP error



If an HTTP error occurs during `west blobs fetch`, the response was written
to a file (even if the response body is empty), and then the checksum
validation fails, which can be somewhat confusing.

Add an immediate error message and exit-with-error-code when the HTTP
request fails.

Tested by modify a blob manifest to have an invalid URL:

```bash
# test with invalid URL
❯ west blobs fetch nrf_wifi
Fetching blob nrf_wifi: .../wifi_fw_bins/default/nrf70.bin
ERROR: HTTP error occurred: 404 Client Error: Not Found for url: ...

# test with networking disabled
❯ west blobs fetch nrf_wifi
Fetching blob nrf_wifi: .../wifi_fw_bins/default/nrf70.bin
ERROR: An error occurred: HTTPSConnectionPool(host='git.... \
  Max retries exceeded with url: \
  .../zzzz/nrf_wifi/bin/zephyr/default/nrf70.bin
...
```

Signed-off-by: default avatarNoah Pendleton <noah.pendleton@gmail.com>
parent a95f900b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment