From 1729619272b6d4196b5faa7148906fa07fb8d7e9 Mon Sep 17 00:00:00 2001 From: James Lloyd Date: Mon, 1 Jul 2024 09:49:46 +0100 Subject: [PATCH] #1118 throw exceptions returned from BucketExistsAsync --- Minio/ApiEndpoints/BucketOperations.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Minio/ApiEndpoints/BucketOperations.cs b/Minio/ApiEndpoints/BucketOperations.cs index 1a7cb5f02a..3df134232f 100644 --- a/Minio/ApiEndpoints/BucketOperations.cs +++ b/Minio/ApiEndpoints/BucketOperations.cs @@ -80,9 +80,8 @@ public async Task BucketExistsAsync(BucketExistsArgs args, CancellationTok using var response = await this.ExecuteTaskAsync(ResponseErrorHandlers, requestMessageBuilder, cancellationToken: cancellationToken).ConfigureAwait(false); - return response is not null && - (response.Exception is null || - response.Exception.GetType() != typeof(BucketNotFoundException)); + + return response?.Exception != null ? throw response.Exception : response is not null; } catch (InternalClientException ice) {