Skip to content

Commit 1c19fda

Browse files
committed
preventMultipleWaits function
1 parent da2e5e0 commit 1c19fda

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/core/src/v3/runtime/preventMultipleWaits.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { ConcurrentWaitError } from "../errors.js";
1+
import { InternalError } from "../errors.js";
2+
import { TaskRunErrorCodes } from "../schemas/common.js";
23

34
const concurrentWaitErrorMessage =
45
"Parallel waits are not supported, e.g. using Promise.all() around our wait functions.";
@@ -9,7 +10,12 @@ export function preventMultipleWaits() {
910
return async <T>(cb: () => Promise<T>): Promise<T> => {
1011
if (isExecutingWait) {
1112
console.error(concurrentWaitErrorMessage);
12-
throw new ConcurrentWaitError(concurrentWaitErrorMessage);
13+
throw new InternalError({
14+
code: TaskRunErrorCodes.TASK_DID_CONCURRENT_WAIT,
15+
message: concurrentWaitErrorMessage,
16+
skipRetrying: true,
17+
showStackTrace: false,
18+
});
1319
}
1420

1521
isExecutingWait = true;

0 commit comments

Comments
 (0)