Also catch gaierror in !rdns, print e.strerror instead of str(e)
This commit is contained in:
parent
078891127d
commit
ded6ff03ce
1 changed files with 2 additions and 2 deletions
|
@ -62,7 +62,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
event["stderr"].set_prefix("rDNS")
|
event["stderr"].set_prefix("rDNS")
|
||||||
try:
|
try:
|
||||||
hostname, alias, ips = socket.gethostbyaddr(event["args_split"][0])
|
hostname, alias, ips = socket.gethostbyaddr(event["args_split"][0])
|
||||||
except socket.herror as e:
|
except (socket.herror, socket.gaierror) as e:
|
||||||
event["stderr"].write(str(e))
|
event["stderr"].write(e.strerror)
|
||||||
return
|
return
|
||||||
event["stdout"].write("%s: %s" % (ips[0], hostname))
|
event["stdout"].write("%s: %s" % (ips[0], hostname))
|
||||||
|
|
Loading…
Reference in a new issue