Fixed handling of unknown field error
This commit is contained in:
parent
54a9c78534
commit
4fca68c6f0
|
@ -53,10 +53,9 @@ class Writer(multiprocessing.Process):
|
||||||
try:
|
try:
|
||||||
for source in select(self.db, value):
|
for source in select(self.db, value):
|
||||||
write(self.db, name, updated, source=source)
|
write(self.db, name, updated, source=source)
|
||||||
except (ValueError, IndexError, KeyError):
|
except (ValueError, IndexError):
|
||||||
# ValueError: non-number in IP
|
# ValueError: non-number in IP
|
||||||
# IndexError: IP too big, missing field
|
# IndexError: IP too big
|
||||||
# KeyError: Unknown type field
|
|
||||||
self.log.exception("Cannot execute: %s", record)
|
self.log.exception("Cannot execute: %s", record)
|
||||||
|
|
||||||
def end(self) -> None:
|
def end(self) -> None:
|
||||||
|
@ -149,7 +148,9 @@ class Rapid7Parser(Parser):
|
||||||
data['name'],
|
data['name'],
|
||||||
data['value']
|
data['value']
|
||||||
)
|
)
|
||||||
except IndexError:
|
except (IndexError, KeyError):
|
||||||
|
# IndexError: missing field
|
||||||
|
# KeyError: Unknown type field
|
||||||
self.log.exception("Cannot parse: %s", line)
|
self.log.exception("Cannot parse: %s", line)
|
||||||
self.register(record)
|
self.register(record)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue