Skip to content

Commit

Permalink
more informative download error
Browse files Browse the repository at this point in the history
  • Loading branch information
nreinicke committed May 30, 2024
1 parent 9c46b2b commit 0c5b031
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "nrel.routee.compass"
version = "0.8.0"
version = "0.8.1"
description = "An eco-routing tool build upon RouteE-Powertrain"
readme = "README.md"
documentation = "nrel.github.io/routee-compass"
Expand Down
8 changes: 7 additions & 1 deletion python/nrel/routee/compass/io/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ def _download_tile(

with requests.get(url, stream=True) as r:
log.info(f"downloading {tile}")
r.raise_for_status()
try:
r.raise_for_status()
except requests.exceptions.HTTPError as e:
raise ValueError(
f"Failed to download USGS tile {tile} from {url}. "
"If this road network is outside of the US, consider re-running with `grade=False`."
) from e

destination.parent.mkdir(exist_ok=True)

Expand Down

0 comments on commit 0c5b031

Please sign in to comment.