Skip to content

Commit b1af945

Browse files
authored
fix: stop processing resource data records on error (#459)
Signed-off-by: Aurora Gaffney <aurora@blinklabs.io>
1 parent 31ca56e commit b1af945

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

handshake/domain.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,17 @@ recordLoop:
107107
if record != nil {
108108
err = record.decode(r)
109109
if err != nil {
110-
return fmt.Errorf("decode record: %w", err)
110+
// Stop processing on record decode failure
111+
// Don't return an error, because we want to return whatever records
112+
// that we were able to process successfully
113+
break recordLoop
111114
}
112115
}
113116
d.Records = append(d.Records, record)
114117
}
118+
// golangci-lint doesn't like it that we break out of the loop on decode error but
119+
// return a nil error here
120+
// nolint:nilerr
115121
return nil
116122
}
117123

0 commit comments

Comments
 (0)