From 24ebcf13cf51018b1a72bae70e0a41a70ea4d803 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 25 Jan 2021 14:39:16 -0800 Subject: [PATCH] fix: make listing consistent with top level delete marker (#3587) ``` ~ mc ls s3/tbucket13/x.txt [2021-01-25 13:24:09 PST] 525B z.txt ``` ``` ~ mc ls s3/tbucket132/x.txt [2021-01-25 13:31:41 PST] 525B x.txt/z.txt ``` --- cmd/client-s3.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/client-s3.go b/cmd/client-s3.go index 1d3566c6..7801dd1b 100644 --- a/cmd/client-s3.go +++ b/cmd/client-s3.go @@ -1408,8 +1408,9 @@ func (c *S3Client) Stat(ctx context.Context, opts StatOptions) (*ClientContent, if err == nil { return ctnt, nil } + // Ignore object missing error but return for other errors - if !errors.As(err.ToGoError(), &ObjectMissing{}) { + if !errors.As(err.ToGoError(), &ObjectMissing{}) && !errors.As(err.ToGoError(), &ObjectIsDeleteMarker{}) { return nil, err } }