summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xnaros.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/naros.py b/naros.py
index a77cd7f..0e38563 100755
--- a/naros.py
+++ b/naros.py
@@ -653,7 +653,13 @@ class NftMonitor:
def process(self, process_cb):
for line in self._child.stdout:
- cmd, val = nft_json_pop(json.loads(line))
+ try:
+ data = json.loads(line)
+ except json.decoder.JSONDecodeError:
+ self._logger.error('Error decoding event: %s', line)
+ continue
+
+ cmd, val = nft_json_pop(data)
self._logger.debug('Nft event: %s %s', cmd, val)