-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQS error code not match #5090
Comments
Hi @chuzui , Thanks for the message, I can confirm this behavior. I think the problem is that the Go v1 SDK is drawing the error from the header rather than the body. As you can see the following response :
The SQS response contains both error codes; I'm not sure what the fix here should be, but this is working correctly in v2: func main() {
ctx := context.Background()
cfg, err := config.LoadDefaultConfig(ctx, config.WithRegion("us-east-1"), config.WithClientLogMode(aws.LogResponseWithBody))
if err != nil {
log.Fatalf("unable to load SDK config, %v", err)
}
client := sqs.NewFromConfig(cfg)
_, err = client.GetQueueUrl(context.TODO(), &sqs.GetQueueUrlInput{
QueueName: aws.String("fake-foo-queue"),
})
if err != nil {
var e *types.QueueDoesNotExist
if errors.As(err, &e) {
fmt.Println("\n we get the expected error")
} else {
panic(err)
}
}
}
/*
we get the expected error
*/ We will further look into it. |
@chuzui thanks for creating the issue. Your worry is valid, and we are actively working on amending back to the older customer experience. And, I will update this thread as we progress. in the meantime, the deserialized error some context around the source of the issue: |
|
Describe the bug
After the #5060, for example, the error code of deleting a non-existent queue is changed from
AWS.SimpleQueueService.NonExistentQueue
toNonExistentQueue
. But the SQS api comes back withAWS.SimpleQueueService.NonExistentQueue
in practise and make the error code check unworkable.aws/aws-sdk-go-v2#2348
aws/aws-sdk#105
Expected Behavior
The error code of deleting a non-existent queue can match
sqs.ErrCodeQueueDoesNotExist
Current Behavior
Not match
Reproduction Steps
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
The text was updated successfully, but these errors were encountered: