Skip to content

Commit

Permalink
Update pkg/store/bucket.go
Browse files Browse the repository at this point in the history
Co-authored-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com>
  • Loading branch information
thibaultmg and saswatamcode authored May 4, 2023
1 parent 31e49d5 commit 5d8a0bd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -1574,13 +1574,11 @@ func (s *BucketStore) LabelNames(ctx context.Context, req *storepb.LabelNamesReq
s.mtx.RUnlock()

if err := g.Wait(); err != nil {
if statusErr, ok := status.FromError(err); ok {
if statusErr.Code() == codes.ResourceExhausted {
return nil, status.Error(codes.ResourceExhausted, err.Error())
}
code := codes.Internal
if s, ok := status.FromError(errors.Cause(err)); ok {
code = s.Code()
}

return nil, status.Error(codes.Internal, err.Error())
return nil, status.Error(code, err.Error())
}

anyHints, err := types.MarshalAny(resHints)
Expand Down

0 comments on commit 5d8a0bd

Please sign in to comment.