From 06c5846709ccadf9ef8fb4f933e5f96b95596f29 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Plogmann Date: Mon, 3 Oct 2016 12:50:20 +0200 Subject: [PATCH] added error logging for http plugin --- plugins/httpRequest/httpRequest.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/httpRequest/httpRequest.py b/plugins/httpRequest/httpRequest.py index c502c3c..bed2820 100644 --- a/plugins/httpRequest/httpRequest.py +++ b/plugins/httpRequest/httpRequest.py @@ -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: