Remove unused aws-sdk-go v1 error checking

This commit is contained in:
Peter Rifel 2024-04-20 13:09:05 -04:00
parent a1514b91b4
commit d809f2a888
No known key found for this signature in database
1 changed files with 0 additions and 7 deletions

View File

@ -34,7 +34,6 @@ import (
elbtypes "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types"
elbv2types "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types"
iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/smithy-go"
"k8s.io/klog/v2"
"k8s.io/kops/pkg/apis/kops"
@ -156,9 +155,6 @@ func FindELBV2Tag(tags []elbv2types.Tag, key string) (string, bool) {
// AWSErrorCode returns the aws error code, if it is an awserr.Error or smithy.APIError, otherwise ""
func AWSErrorCode(err error) string {
if awsError, ok := err.(awserr.Error); ok {
return awsError.Code()
}
var apiErr smithy.APIError
if errors.As(err, &apiErr) {
return apiErr.ErrorCode()
@ -168,9 +164,6 @@ func AWSErrorCode(err error) string {
// AWSErrorMessage returns the aws error message, if it is an awserr.Error or smithy.APIError, otherwise ""
func AWSErrorMessage(err error) string {
if awsError, ok := err.(awserr.Error); ok {
return awsError.Message()
}
var apiErr smithy.APIError
if errors.As(err, &apiErr) {
return apiErr.ErrorMessage()