Closed
Description
Describe the bug
Waiter doesn't error on timeout.
It's tested by waiting for a bucket which doesn't exist.
SDK version number
3.3.0
Is the issue in the browser/Node.js/ReactNative?
All
Details of the browser/Node.js/ReactNative version
N/A
To Reproduce (observed behavior)
v2 Code
const AWS = require("aws-sdk");
(async () => {
const region = "us-west-2";
const client = new AWS.S3({ region });
const Bucket = "test-waiters-bucket-does-not-exist";
await client
.waitFor("bucketExists", { Bucket, $waiter: { delay: 2, maxAttempts: 3 } })
.promise();
})();
v2 Output
(node:14350) UnhandledPromiseRejectionWarning: NotFound: Resource is not in the state bucketExists
...
v3 Code
import { S3, waitForBucketExists } from "@aws-sdk/client-s3";
(async () => {
const region = "us-west-2";
const client = new S3({ region });
const Bucket = "test-waiters-bucket-does-not-exist";
await waitForBucketExists({ client, maxWaitTime: 30 }, { Bucket });
})();
v3 Output
// No output, it should error on timeout.
Expected behavior
Waiter should error on timeout.