Log HTTP header for status codes != 200
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Jul 2014 15:50:20 +0000 (15:50 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Jul 2014 15:50:20 +0000 (15:50 +0000)
src/ddns/system.py

index cab2942..6b76333 100644 (file)
@@ -166,6 +166,11 @@ class DDNSSystem(object):
                        return resp
 
                except urllib2.HTTPError, e:
+                       # Log response header.
+                       logger.debug(_("Response header (Status Code %s):") % e.code)
+                       for k, v in e.hdrs.items():
+                               logger.debug("  %s: %s" % (k, v))
+
                        # 400 - Bad request
                        if e.code == 400:
                                raise DDNSRequestError(e.reason)