Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/sns/lib/utils/snsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,14 @@ export async function assertTopic(
} catch (error) {
if (!isError(error)) throw error
// To build ARN we need topic name and error should be "topic already exist with different tags"
if (!topicOptions.Name || !isTopicAlreadyExistWithDifferentTagsError(error)) throw error
if (!topicOptions.Name || !isTopicAlreadyExistWithDifferentTagsError(error)) {
throw new InternalError({
message: `${topicOptions.Name} - ${error.message}`,
cause: error,
details: { topicName: topicOptions.Name },
errorCode: 'SNS_CREATE_TOPIC_COMMAND_UNEXPECTED_ERROR',
})
}

topicArn = await buildTopicArn(stsClient, topicOptions.Name)
if (!extraParams?.forceTagUpdate) {
Expand All @@ -106,6 +113,7 @@ export async function assertTopic(
throw new InternalError({
message: `${topicOptions.Name} - ${error.message}`,
details: {
topicName: topicOptions.Name,
currentTags: JSON.stringify(currentTags),
newTags: JSON.stringify(topicOptions.Tags),
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sns/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@message-queue-toolkit/sns",
"version": "21.1.1",
"version": "21.1.2",
"private": false,
"license": "MIT",
"description": "SNS adapter for message-queue-toolkit",
Expand Down
Loading