Skip to content

Commit

Permalink
fix(bed-4320): Return an error if decoding fails (#806)
Browse files Browse the repository at this point in the history
  • Loading branch information
neumachen authored Aug 22, 2024
1 parent 514e1c8 commit 83909a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/api/src/daemons/datapipe/decoders.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ func decodeBasicData[T any](batch graph.Batch, reader io.ReadSeeker, conversionF
)

for decoder.More() {
//This variable needs to be initialized here, otherwise the marshaller will cache the map in the struct
// This variable needs to be initialized here, otherwise the marshaller will cache the map in the struct
var decodeTarget T
if err := decoder.Decode(&decodeTarget); err != nil {
log.Errorf("Error decoding %T object: %v", decodeTarget, err)
if errors.Is(err, io.EOF) {
break
}
return err
} else {
count++
conversionFunc(decodeTarget, &convertedData)
Expand Down

0 comments on commit 83909a3

Please sign in to comment.