minio / minio-dotnet

MinIO Client SDK for .NET
https://docs.min.io/docs/dotnet-client-quickstart-guide.html
Apache License 2.0
575 stars 230 forks source link

BucketExistsAsync seems to need a bit of refactoring #1132

Open marwa-elfakir-logi opened 4 months ago

marwa-elfakir-logi commented 4 months ago

As of version 6.0.3 today this is current implementation of BucketExistsAsync

image

I noticed that in the part

image

if an InternalClientException is caught, then the function will return true in these 2 cases :

  1. ice.ServerResponse is null && ice.ServerResponse is not null
  2. ice.ServerResponse is not null && HttpStatusCode.NotFound != ice.ServerResponse.StatusCode
ebozduman commented 4 months ago

@marwa-elfakir-logi ,

It looks like this is the same issue with #1131 you filed before. Although they are duplicates, I'll keep it open so that you can try all your scenarios to test the fix, PR #1141, for this issue and if you are satisfied, to close the issue.