Skip to content

Commit

Permalink
fix: propagate fetcher errors back to the user
Browse files Browse the repository at this point in the history
  • Loading branch information
reubenmiller committed Jan 22, 2025
1 parent af1c9b7 commit 7a66c80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion pkg/c8yfetcher/c8yfetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ func lookupEntity(fetch EntityFetcher, values []string, getID bool, format strin
Data: resultSet,
})
}
} else {
// Propagate errors back to the caller
return entities, err
}
// TODO: Handle error
}

return entities, nil
Expand Down
6 changes: 2 additions & 4 deletions pkg/mapbuilder/mapbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1060,10 +1060,8 @@ func (b *MapBuilder) MarshalJSONObject() (body []byte, err error) {
Logger.Debugf("body iterator. path=%s, value=%s", it.Path, value)

if itErr != nil {
if itErr == io.EOF {
err = itErr
return
}
err = itErr
return
} else {
switch extInput := input.(type) {
case []byte:
Expand Down

0 comments on commit 7a66c80

Please sign in to comment.