From 4f4694861f149b4a18441604f12b8c307e8578a2 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Mon, 9 Oct 2023 14:29:37 +0100 Subject: [PATCH] custom-broker-acceptance-tests: better error reporting for s3 tests --- platform-tests/example-apps/healthcheck/s3.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform-tests/example-apps/healthcheck/s3.go b/platform-tests/example-apps/healthcheck/s3.go index 42ea0087a1..337c6f299c 100644 --- a/platform-tests/example-apps/healthcheck/s3.go +++ b/platform-tests/example-apps/healthcheck/s3.go @@ -52,7 +52,7 @@ func testS3BucketAccess() error { Bucket: aws.String(vcapService.BucketName), }) if err != nil { - return err + return errors.Wrap(err, "ListObjects") } _, err = s3Client.PutObject(&s3.PutObjectInput{ @@ -61,7 +61,7 @@ func testS3BucketAccess() error { Body: strings.NewReader(testS3Content), }) if err != nil { - return err + return errors.Wrap(err, "PutObject") } getObjectOutput, err := s3Client.GetObject(&s3.GetObjectInput{ @@ -69,12 +69,12 @@ func testS3BucketAccess() error { Key: aws.String(testS3File), }) if err != nil { - return err + return errors.Wrap(err, "GetObject") } content, err := ioutil.ReadAll(getObjectOutput.Body) if err != nil { - return err + return errors.Wrap(err, "ioutil.ReadAll") } defer getObjectOutput.Body.Close() @@ -87,7 +87,7 @@ func testS3BucketAccess() error { Key: aws.String(testS3File), }) if err != nil { - return err + return errors.Wrap(err, "DeleteObject") } return nil