Skip to content

Commit 6de3c2a

Browse files
author
Ersan Bozduman
committed
Addresses ignored func test case exceptions
1 parent 8b31ca9 commit 6de3c2a

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Minio.Functional.Tests/FunctionalTest.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -594,17 +594,17 @@ internal static async Task TearDown(IMinioClient minio, string bucketName)
594594
{
595595
var beArgs = new BucketExistsArgs()
596596
.WithBucket(bucketName);
597-
var bktExists = await minio.BucketExistsAsync(beArgs).ConfigureAwait(false);
598-
if (!bktExists)
599-
return;
600597
var getVersions = false;
601-
// Get Versioning/Retention Info.
602-
var lockConfigurationArgs =
603-
new GetObjectLockConfigurationArgs()
604-
.WithBucket(bucketName);
605-
ObjectLockConfiguration lockConfig = null;
598+
var lockConfig = new ObjectLockConfiguration();
606599
try
607600
{
601+
var bktExists = await minio.BucketExistsAsync(beArgs).ConfigureAwait(false);
602+
if (!bktExists)
603+
return;
604+
// Get Versioning/Retention Info.
605+
var lockConfigurationArgs =
606+
new GetObjectLockConfigurationArgs()
607+
.WithBucket(bucketName);
608608
var versioningConfig = await minio.GetVersioningAsync(new GetVersioningArgs()
609609
.WithBucket(bucketName)
610610
.WithVersions(true)).ConfigureAwait(false);

Minio/RequestExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ await requestMessageBuilder.ResponseWriter(responseResult.ContentStream, cancell
143143
{
144144
if (ex.Message.Equals("ThrowBucketNotFoundException", StringComparison.Ordinal))
145145
throw new BucketNotFoundException();
146+
147+
if (responseResult is not null) responseResult.Exception = ex;
148+
else return new ResponseResult(request, ex);
146149
throw;
147150
}
148151
}

0 commit comments

Comments
 (0)