Skip to content

Commit

Permalink
Split up validity checking
Browse files Browse the repository at this point in the history
Much easier to reason about why things are being skipped if the log
messages are explicit.
  • Loading branch information
eest committed Sep 26, 2024
1 parent 5e783a9 commit 8ecaf80
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 8ecaf80

Please sign in to comment.