Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
no urllib2.URLError property called 'code'
# send the request to pushover
req = urllib2.Request(API_URL)
handle = urllib2.urlopen(req, data)
except urllib2.HTTPError as e:
logger.log(u'PUSHOVER: HTTPError: %s' % e.args, logger.ERROR)
except urllib2.URLError as e:
# HTTP status 404 if the provided email address isn't a Pushover user.
logger.log(u'PUSHOVER: URLError: %s' % e.reason, logger.ERROR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment