From e80eb3a59cb66d4a059c36866198ca2cf55ab6dd Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Sat, 12 Nov 2022 16:26:18 -0500 Subject: [PATCH] mantle/platform: fix error handling in ibmcloud/s3 CopyObject I suspect this was a copy/paste error. `BucketAlreadyOwnedByYou` is an error reported from createBucket(), which we aren't calling here. --- mantle/platform/api/ibmcloud/s3.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mantle/platform/api/ibmcloud/s3.go b/mantle/platform/api/ibmcloud/s3.go index 4f9adf04d3..5dcd03528f 100644 --- a/mantle/platform/api/ibmcloud/s3.go +++ b/mantle/platform/api/ibmcloud/s3.go @@ -174,10 +174,9 @@ func (a *API) CopyObject(srcBucket, srcName, destBucket string) error { }) if err != nil { if awserr, ok := err.(awserr.Error); ok { - if awserr.Code() == "BucketAlreadyOwnedByYou" { - return nil - } + err = awserr } + return fmt.Errorf("Error copying object to bucket: %v", err) } // Wait to see if the item got copied