Skip to content

Commit f181eae

Browse files
authored
Merge pull request #171 from yaron-cider/patch-1
Better error handling
2 parents 8d2630e + 5366237 commit f181eae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

shodan/client.py

+2
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ def _request(self, function, params, service='shodan', method='get'):
336336
raise APIError(error)
337337
elif data.status_code == 403:
338338
raise APIError('Access denied (403 Forbidden)')
339+
elif data.status_code == 502:
340+
raise APIError('Bad Gateway (502)')
339341

340342
# Parse the text into JSON
341343
try:

0 commit comments

Comments
 (0)