Skip to content
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

feat(util-waiter): aggregate observed responses in waiter response #1467

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented Dec 6, 2024

Addresses: aws/aws-sdk-js-v3#6699

Collects a count of observed responses during the polling of a waiter.

code:

import { IAM, waitUntilUserExists } from "@aws-sdk/client-iam";

const iam = new IAM({ region: "us-west-2" });

await waitUntilUserExists(
  {
    client: iam,
    maxWaitTime: 15.001,
  },
  {
    UserName: "echo2",
  }
);

old:

Error [TimeoutError]: {"state":"TIMEOUT","reason":"Waiter has timed out"}

new (when failed):

Error [TimeoutError]: {
	"state":"TIMEOUT",
	"observedResponses":{"404: The user with name echo2 cannot be found.":5},
	"reason":"Waiter has timed out"
}

new (when unauthorized):

Error [TimeoutError]: {
	"state":"TIMEOUT",
	"observedResponses":
		{"403: User: arn:aws:sts::... is not authorized to perform: iam:GetUser on resource: user echo2 because no identity-based policy allows the iam:GetUser action":5},
	"reason":"Waiter has timed out"
}

@kuhe kuhe requested a review from a team as a code owner December 6, 2024 18:53
@kuhe kuhe merged commit 8950c05 into smithy-lang:main Dec 9, 2024
11 checks passed
@kuhe kuhe deleted the feat/waiters branch December 9, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants