Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BucketExistsAsync seems to need a bit of refactoring #1132

Open
marwa-elfakir-logi opened this issue Jul 12, 2024 · 1 comment
Open

BucketExistsAsync seems to need a bit of refactoring #1132

marwa-elfakir-logi opened this issue Jul 12, 2024 · 1 comment

Comments

@marwa-elfakir-logi
Copy link

marwa-elfakir-logi commented Jul 12, 2024

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
  • The first case is a contradictory condition
    maybe u meant to write second case only ? or maybe smt else (either way it seems to need some refactoring)

  • The second case is a bit confusing ? why would we consider the bucket exists if the StatusCode was different from NotFound ? Do all other InternalClientException.ServerResponse.StatusCode cases mean the bucket exist ?? shouldn't we let the exception be thrown in some cases ?

@ebozduman
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants