Skip to content

DoesS3BucketExistV2Async throws an exception #2617

Discussion options

You must be logged in to vote

Hi @MaksimSimpleCode,

Good morning.

Per AmazonS3Util.DoesS3BucketExistV2Async(), False is returned in case S3 responds with a NoSuchBucket error. True is returned in case of success, AccessDenied error or PermanentRedirect error. An exception is thrown in case of any other error.. If you refer code for this method, it makes AmazonS3Client.GetACLAsync() call to check the existence of the bucket.

I tried with the below code (which enables verbose logging):

using (AmazonS3Client client = new AmazonS3Client(RegionEndpoint.USWest2))
{
      AWSConfigs.LoggingConfig.LogTo = LoggingOptions.Console;
      AWSConfigs.LoggingConfig.LogResponses = ResponseLoggingOption.Always;
      AWSConfigs.Loggi…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ashishdhingra
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants