Skip to content

Commit e6e5783

Browse files
committed
feat(util-waiter): include reason on waiter result
1 parent 243f2d0 commit e6e5783

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/util-waiter/src/poller.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export const runPolling = async <Client, Input>(
2525
input: Input,
2626
acceptorChecks: (client: Client, input: Input) => Promise<WaiterResult>
2727
): Promise<WaiterResult> => {
28-
const { state } = await acceptorChecks(client, input);
28+
const { state, reason } = await acceptorChecks(client, input);
2929
if (state !== WaiterState.RETRY) {
30-
return { state };
30+
return { state, reason };
3131
}
3232

3333
let currentAttempt = 1;
@@ -46,9 +46,9 @@ export const runPolling = async <Client, Input>(
4646
return { state: WaiterState.TIMEOUT };
4747
}
4848
await sleep(delay);
49-
const { state } = await acceptorChecks(client, input);
49+
const { state, reason } = await acceptorChecks(client, input);
5050
if (state !== WaiterState.RETRY) {
51-
return { state };
51+
return { state, reason };
5252
}
5353

5454
currentAttempt += 1;

0 commit comments

Comments
 (0)