Skip to content

Commit 4c5c862

Browse files
mikeeedapr-botnelson-parente
authored
fix(tests): remove aws error casting (dapr#3821)
Signed-off-by: Mike Nguyen <hey@mike.ee> Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com> Co-authored-by: Nelson Parente <nelson_parente@live.com.pt>
1 parent a9dafe6 commit 4c5c862

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

tests/certification/pubsub/aws/snssqs/snssqs_helper.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"fmt"
1919

2020
"github.com/aws/aws-sdk-go/aws"
21-
"github.com/aws/aws-sdk-go/aws/awserr"
2221
"github.com/aws/aws-sdk-go/aws/session"
2322
"github.com/aws/aws-sdk-go/service/sns"
2423
"github.com/aws/aws-sdk-go/service/sns/snsiface"
@@ -164,22 +163,8 @@ func sqsService() *sqs.SQS {
164163

165164
func getIdentity(svc stsiface.STSAPI) (*sts.GetCallerIdentityOutput, error) {
166165
input := &sts.GetCallerIdentityInput{}
167-
result, err := svc.GetCallerIdentity(input)
168-
if err != nil {
169-
if aerr, ok := err.(awserr.Error); ok {
170-
switch aerr.Code() {
171-
default:
172-
return nil, fmt.Errorf(aerr.Error())
173-
}
174-
} else {
175-
// Print the error, cast err to awserr.Error to get the Code and
176-
// Message from an error.
177-
return nil, fmt.Errorf(aerr.Error())
178-
}
179-
return nil, err
180-
}
181166

182-
return result, nil
167+
return svc.GetCallerIdentity(input)
183168
}
184169

185170
func buildARN(partition, serviceName, entityName, region string, id *sts.GetCallerIdentityOutput) string {

0 commit comments

Comments
 (0)