Skip to content

Commit

Permalink
Catch and raise HTTP 403 Forbidden errors (#958)
Browse files Browse the repository at this point in the history
* Catch and raise HTTP 403 Forbidden errors
  • Loading branch information
geographika authored Nov 28, 2024
1 parent d5e650d commit 1354d06
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 1354d06

Please sign in to comment.