Fixed handling of unknown field error

このコミットが含まれているのは:
Geoffrey Frogeye 2019-12-27 01:10:21 +01:00
コミット 4fca68c6f0
署名者: geoffrey
GPGキーID: D8A7ECA00A8CD3DD
1個のファイルの変更5行の追加4行の削除

ファイルの表示

@ -53,10 +53,9 @@ class Writer(multiprocessing.Process):
try:
for source in select(self.db, value):
write(self.db, name, updated, source=source)
except (ValueError, IndexError, KeyError):
except (ValueError, IndexError):
# ValueError: non-number in IP
# IndexError: IP too big, missing field
# KeyError: Unknown type field
# IndexError: IP too big
self.log.exception("Cannot execute: %s", record)
def end(self) -> None:
@ -149,7 +148,9 @@ class Rapid7Parser(Parser):
data['name'],
data['value']
)
except IndexError:
except (IndexError, KeyError):
# IndexError: missing field
# KeyError: Unknown type field
self.log.exception("Cannot parse: %s", line)
self.register(record)