From dd40c24998b8d95d9446c3dcf96226b9d2fed666 Mon Sep 17 00:00:00 2001 From: N-o-Z Date: Sun, 16 Jun 2024 21:43:57 +0300 Subject: [PATCH] Enrich error on no staging token (#7873) --- pkg/graveler/graveler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/graveler/graveler.go b/pkg/graveler/graveler.go index 3e1bf83ca21..2b570a951ca 100644 --- a/pkg/graveler/graveler.go +++ b/pkg/graveler/graveler.go @@ -1577,7 +1577,7 @@ func (g *Graveler) SetBranchProtectionRules(ctx context.Context, repository *Rep // TODO: in most cases it is used by Get flow, assuming that usually the key will be found in committed we need to parallelize the get from tokens func (g *Graveler) getFromStagingArea(ctx context.Context, b *Branch, key Key) (*Value, error) { if b.StagingToken == "" { - return nil, ErrNotFound + return nil, fmt.Errorf("missing staging token: %w", ErrNotFound) } tokens := []StagingToken{b.StagingToken} tokens = append(tokens, b.SealedTokens...) @@ -1870,7 +1870,7 @@ func (g *Graveler) deleteUnsafe(ctx context.Context, repository *RepositoryRecor // listStagingAreaWithoutCompaction will not return changes that were already compacted and saved in the CompactedBaseMetaRangeID func (g *Graveler) listStagingAreaWithoutCompaction(ctx context.Context, b *Branch, batchSize int) (ValueIterator, error) { if b.StagingToken == "" { - return nil, ErrNotFound + return nil, fmt.Errorf("missing staging token: %w", ErrNotFound) } it := g.StagingManager.List(ctx, b.StagingToken, batchSize)