catch EOFError exception, add note about readable exception messages PR, fixes #197
This commit is contained in:
parent
f6f98e7971
commit
0c95fbacaf
@ -325,10 +325,15 @@ def update_ns(fqdn, rdtype='A', ipaddr=None, action='upd', ttl=60):
|
|||||||
rcode_text, action, name, origin, rdtype, ipaddr))
|
rcode_text, action, name, origin, rdtype, ipaddr))
|
||||||
raise DnsUpdateError(rcode_text)
|
raise DnsUpdateError(rcode_text)
|
||||||
return response
|
return response
|
||||||
|
# TODO simplify exception handling when https://github.com/rthalley/dnspython/pull/85 is merged/released
|
||||||
except socket.error as e:
|
except socket.error as e:
|
||||||
logger.error("socket.error [%s] - zone: %s" % (str(e), origin, ))
|
logger.error("socket.error [%s] - zone: %s" % (str(e), origin, ))
|
||||||
set_ns_availability(domain, False)
|
set_ns_availability(domain, False)
|
||||||
raise DnsUpdateError("SocketError %d" % e.errno)
|
raise DnsUpdateError("SocketError %d" % e.errno)
|
||||||
|
except EOFError as e:
|
||||||
|
logger.error("EOFError [%s] - zone: %s" % (str(e), origin, ))
|
||||||
|
set_ns_availability(domain, False)
|
||||||
|
raise DnsUpdateError("EOFError")
|
||||||
except dns.exception.Timeout:
|
except dns.exception.Timeout:
|
||||||
logger.warning("timeout when performing %s for name %s and origin %s with rdtype %s and ipaddr %s" % (
|
logger.warning("timeout when performing %s for name %s and origin %s with rdtype %s and ipaddr %s" % (
|
||||||
action, name, origin, rdtype, ipaddr))
|
action, name, origin, rdtype, ipaddr))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user