Skip to content

bug: Topic not found, error message does not match #7861

@artur-ma

Description

@artur-ma

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Im using AWS SDK v3
We use the GetTopicAttributesCommand to validate topic existence (there is not other way to do it), then we check the error code and error message.

When trying to get attributes of a topic by ARN with lockstack, it returns error with different error message than AWS:

{
    Code: 'NotFound',
    Message: 'Topic with arn <MY ARN> not found',
    message: 'Topic with arn <MY ARN> not found'
  }

The original AWS error

{
  Type: "Sender",
  Code: "NotFound",
  Message: "Topic does not exist",
  message: "Topic does not exist"
}

Expected Behavior

Lockstack should return exact same error structure as AWS cloud

{
  Type: "Sender",
  Code: "NotFound",
  Message: "Topic does not exist",
  message: "Topic does not exist"
}

How are you starting LocalStack?

With the localstack script

Steps To Reproduce

  const client = new SNSClient({ })
  try {
    await client.send(new GetTopicAttributesCommand({ TopicArn: '<ARN TO TEST>' }))
  } catch (err) {
    console.log(err)
  }

Run this both with AWS and lockstack and u will see the diff

Environment

- OS: osX
- LocalStack:latest

Anything else?

No response

Metadata

Metadata

Assignees

Labels

aws:snsAmazon Simple Notification Servicestatus: confirmedBug report was confirmedtype: bugBug report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions