Skip to content

Commit

Permalink
Merge pull request #26 from jsoref/ise
Browse files Browse the repository at this point in the history
handle internal server errors
  • Loading branch information
gescheit authored Mar 19, 2017
2 parents 8c6e70a + 10c7c73 commit eac9391
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion zabbix/zabbix_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,10 @@ def do_request(self, json_obj):
except socket.timeout as e:
raise APITimeout("HTTP read timeout",)
except urllib2.URLError as e:
if hasattr(e, 'message'):
if hasattr(e, 'message') and e.message:
e = e.message
elsif hasattr(e, 'reason'):
e = e.reason
raise ZabbixAPIException("urllib2.URLError - %s" % e)
self.debug(logging.INFO, "Response Code: " + str(response.code))

Expand Down

0 comments on commit eac9391

Please sign in to comment.