Skip to content

Commit

Permalink
Catch and raise HTTP 403 Forbidden errors
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika committed Nov 7, 2024
1 parent ae98c20 commit 5e89cc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion owslib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def openURL(url_base, data=None, method='Get', cookies=None, username=None, pass

req = requests.request(method.upper(), url_base, headers=headers, **rkwargs)

if req.status_code in [400, 401]:
if req.status_code in [400, 401, 403]:
raise ServiceException(req.text)

if req.status_code in [404, 500, 502, 503, 504]: # add more if needed
Expand Down

0 comments on commit 5e89cc5

Please sign in to comment.