From 155e84645daef8cc7592739d586d4410c0efe3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Levente=20T=C3=B3th?= Date: Fri, 1 Dec 2023 10:31:57 +0100 Subject: [PATCH] refactor: write error checks --- pkg/file/joiner/joiner_test.go | 10 ++++++++-- pkg/file/redundancy/getter/getter_test.go | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pkg/file/joiner/joiner_test.go b/pkg/file/joiner/joiner_test.go index f80bdf50f99..37ebe787f3f 100644 --- a/pkg/file/joiner/joiner_test.go +++ b/pkg/file/joiner/joiner_test.go @@ -974,8 +974,14 @@ func TestJoinerRedundancy(t *testing.T) { if err != nil { t.Fatal(err) } - store.Put(ctx, dataChunks[i]) - pipe.Write(chunkData) + err = store.Put(ctx, dataChunks[i]) + if err != nil { + t.Fatal(err) + } + _, err = pipe.Write(chunkData) + if err != nil { + t.Fatal(err) + } } // reader init diff --git a/pkg/file/redundancy/getter/getter_test.go b/pkg/file/redundancy/getter/getter_test.go index 6c071be73ec..addee4b6028 100644 --- a/pkg/file/redundancy/getter/getter_test.go +++ b/pkg/file/redundancy/getter/getter_test.go @@ -52,7 +52,10 @@ func initData(ctx context.Context, erasureBuffer [][]byte, dataShardCount int, s if err != nil { return nil, nil, err } - s.Put(ctx, chunk) + err = s.Put(ctx, chunk) + if err != nil { + return nil, nil, err + } sAddresses = append(sAddresses, chunk.Address()) } for i := dataShardCount; i < len(erasureBuffer); i++ { @@ -60,7 +63,10 @@ func initData(ctx context.Context, erasureBuffer [][]byte, dataShardCount int, s if err != nil { return nil, nil, err } - s.Put(ctx, chunk) + err = s.Put(ctx, chunk) + if err != nil { + return nil, nil, err + } pAddresses = append(pAddresses, chunk.Address()) }