From a2325df5e3cc4df6e364e797f5a29382295022bb Mon Sep 17 00:00:00 2001 From: Jesse Geens Date: Thu, 16 Jan 2025 15:50:35 +0100 Subject: [PATCH] Return an error when EOS returns an error in List --- pkg/eosclient/eosgrpc/eosgrpc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/eosclient/eosgrpc/eosgrpc.go b/pkg/eosclient/eosgrpc/eosgrpc.go index 49f82dd718..c9e18c737c 100644 --- a/pkg/eosclient/eosgrpc/eosgrpc.go +++ b/pkg/eosclient/eosgrpc/eosgrpc.go @@ -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") } }