catch and format "unknown record type" exceptions
This commit is contained in:
parent
6f5c692606
commit
cd299d92eb
1 changed files with 4 additions and 1 deletions
|
@ -58,7 +58,10 @@ class Module(ModuleManager.BaseModule):
|
|||
except dns.resolver.NoAnswer:
|
||||
if not record_type.endswith("?"):
|
||||
raise utils.EventError("Domain does not have a '%s' record"
|
||||
% record_type)
|
||||
% record_type_strip)
|
||||
except dns.rdatatype.UnknownRdatatype:
|
||||
raise utils.EventError("Unknown record type '%s'"
|
||||
% record_type_strip)
|
||||
|
||||
results_str = ["%s: %s" % (t, ", ".join(r)) for t, r in results]
|
||||
event["stdout"].write("(%s) %s" % (hostname, " | ".join(results_str)))
|
||||
|
|
Loading…
Reference in a new issue