aws / aws-sdk

Landing page for the AWS SDKs on GitHub
https://aws.amazon.com/tools/
Other
68 stars 12 forks source link

SQS error code not match #654

Closed chuzui closed 7 months ago

chuzui commented 7 months ago

Describe the bug

After the https://github.com/aws/aws-sdk-go/pull/5060, for example, the error code of deleting a non-existent queue is changed from AWS.SimpleQueueService.NonExistentQueue to NonExistentQueue. But the SQS api comes back with AWS.SimpleQueueService.NonExistentQueue in practise and make the error code check unworkable.

https://github.com/aws/aws-sdk-go-v2/issues/2348 https://github.com/aws/aws-sdk/issues/105

Expected Behavior

The error code of deleting a non-existent queue can match sqs.ErrCodeQueueDoesNotExist

Current Behavior

Not match

Reproduction Steps

input := &sqs.DeleteQueueInput{
                 // non-existent queue
        QueueUrl: aws.String(url),
    }

if _, err := s.DeleteQueue(input); err != nil {
    if ae, ok := err.(awserr.Error); ok && ae.Code() == sqs.ErrCodeQueueDoesNotExist {
        return nil
    } else {
        return err
    }
}

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.47.13

Environment details (Version of Go (go version)? OS name and version, etc.)

go1.19.7 linux/amd64

RanVaknin commented 7 months ago

Hi @chuzui,

Thanks for reaching out. This is a known issue, and needs to be fixed with the SQS team itself.

Related: https://github.com/aws/aws-sdk/issues/105 https://github.com/aws/aws-sdk/issues/516

If you feel inclined, you can help us make this more visible by creating a support ticket in the AWS console. Just make sure to mention to other open internal tickets P86218130 and V694663406 and mention my amazon alias @rvaknin so that support can reach out to me internally.

Thanks again, Ran~

github-actions[bot] commented 7 months ago

This issue is now closed.

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.