Browse Source

Fixed handling of unknown field error

master
Geoffrey Frogeye 1 month ago
parent
commit
4fca68c6f0
Signed by: Geoffrey “Frogeye” Preud'homme <geoffrey@frogeye.fr> GPG Key ID: D8A7ECA00A8CD3DD
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      feed_dns.py

+ 5
- 4
feed_dns.py View File

@@ -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)


Loading…
Cancel
Save