minio/minio-dotnet

BucketExistsAsync does not handle exception properly

nwrox opened this issue · 1 comments

When testing a client configured with a fake endpoint, the method BucketExistsAsync still returns true, because there's not a check for other status codes or the exception isn't thrown here:

catch (InternalClientException ice)
{
if ((ice.ServerResponse is not null &&
HttpStatusCode.NotFound.Equals(ice.ServerResponse.StatusCode)) ||
ice.ServerResponse is null)
return false;
}

Is this correct?