Skip to content

BucketExistsAsync seems to need a bit of refactoring #1132

Open
@marwa-elfakir-logi

Description

@marwa-elfakir-logi

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions