added error logging for http plugin

This commit is contained in:
Jan-Hendrik Plogmann 2016-10-03 12:50:20 +02:00
parent 6da22e331a
commit 06c5846709

View file

@ -94,7 +94,13 @@ def run(typ,freq,data):
# HTTP-Request
#
logging.debug("send %s HTTP request", typ)
urllib2.urlopen(url)
try:
resp = urllib2.urlopen(url)
except urllib2.HTTPError as e:
logging.error("HTTP response: %s", e.code)
except urllib2.URLError as e:
logging.error("HTTP-specific error: %s", e.args)
except: