diff --git a/pyproject.toml b/pyproject.toml index 9009ddf0..60b1b18c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/python/nrel/routee/compass/io/utils.py b/python/nrel/routee/compass/io/utils.py index e7de9de4..6cbab26a 100644 --- a/python/nrel/routee/compass/io/utils.py +++ b/python/nrel/routee/compass/io/utils.py @@ -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)