aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--add-osm-to-mpl.py1
-rw-r--r--basemap.py1
2 files changed, 2 insertions, 0 deletions
diff --git a/add-osm-to-mpl.py b/add-osm-to-mpl.py
index 13b275b..2708f0c 100644
--- a/add-osm-to-mpl.py
+++ b/add-osm-to-mpl.py
@@ -99,6 +99,7 @@ url = URL(x=x_tile, y=y_tile, z=zoom)
# make the request
with requests.get(url) as resp:
+ resp.raise_for_status()
img = Image.open(BytesIO(resp.content))
# plot the tile
diff --git a/basemap.py b/basemap.py
index 86e2ea7..8677892 100644
--- a/basemap.py
+++ b/basemap.py
@@ -29,6 +29,7 @@ def tile(session=None, **url_format_args):
session = requests
with session.get(url.format(**url_format_args)) as resp:
+ resp.raise_for_status()
return Image.open(BytesIO(resp.content))