diff --git a/Minio/ApiEndpoints/BucketOperations.cs b/Minio/ApiEndpoints/BucketOperations.cs index 1a7cb5f02..3df134232 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) {