Skip to content

Commit

Permalink
Raise error when http request fails
Browse files Browse the repository at this point in the history
  • Loading branch information
SorooshMani-NOAA authored and zacharyburnett committed Apr 12, 2022
1 parent 1129f5d commit 0779112
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stormevents/nhc/storms.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ def nhc_storms_gis_archive(year: int = None) -> pandas.DataFrame:

url = 'http://www.nhc.noaa.gov/gis/archive_wsurge.php'
response = requests.get(url, params={'year': year})
if not response.ok:
response.raise_for_status()
soup = BeautifulSoup(response.content, features='html.parser')
table = soup.find('table')

Expand Down

0 comments on commit 0779112

Please sign in to comment.