From 8ecaf80c5bdbe88278d517015c1ba15f2a5dde93 Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Thu, 26 Sep 2024 08:52:17 +0200 Subject: [PATCH] Split up validity checking Much easier to reason about why things are being skipped if the log messages are explicit. --- pkg/runner/runner.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/runner/runner.go b/pkg/runner/runner.go index d4a59a5..64cf65d 100644 --- a/pkg/runner/runner.go +++ b/pkg/runner/runner.go @@ -1438,8 +1438,13 @@ minimiserLoop: // For cases where we were unable to unpack the DNS message we // skip parsing. - if msg == nil || len(msg.Question) == 0 { - edm.log.Error("unable to parse dnstap message, or no question section, skipping parsing", "minimiser_id", minimiserID) + if msg == nil { + edm.log.Error("unable to parse dnstap message, skipping parsing", "minimiser_id", minimiserID) + continue + } + + if len(msg.Question) == 0 { + edm.log.Error("no question section in dnstap message, skipping parsing", "minimiser_id", minimiserID) continue }