Skip to content

Commit

Permalink
Return an error when EOS returns an error in List
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Geens committed Jan 16, 2025
1 parent 6ad3fe0 commit a2325df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/eosclient/eosgrpc/eosgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1259,12 +1259,12 @@ func (c *Client) List(ctx context.Context, auth eosclient.Authorization, dpath s
break
}

// We got an error while reading items. We log this as an error and we return
// the items we have
// We got an error while reading items. We return the error to the user and break off the List operation
// We do not want to return a partial list, because then a sync client may delete local files that are missing on the server
log.Error().Err(err).Str("func", "List").Int("nitems", i).Str("path", dpath).Str("got err from EOS", err.Error()).Msg("")
if i > 0 {
log.Error().Str("path", dpath).Int("nitems", i).Msg("No more items, dirty exit")
return mylst, nil
return nil, errors.Wrap(err, "Error listing files")
}
}

Expand Down

0 comments on commit a2325df

Please sign in to comment.