Skip to content

Commit 6d3f752

Browse files
fix(wait): reword cap errors to say 'async mode'
1 parent 6891a22 commit 6d3f752

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

apps/sim/executor/handlers/wait/wait-handler.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ describe('WaitBlockHandler', () => {
149149
expect(result.status).toBe('waiting')
150150
})
151151

152-
it('should reject seconds as a unit when Async is enabled', async () => {
152+
it('should reject seconds as a unit in async mode', async () => {
153153
await expect(
154154
handler.execute(mockContext, mockBlock, {
155155
async: true,
156156
timeValue: '30',
157157
timeUnitLong: 'seconds',
158158
})
159-
).rejects.toThrow('Seconds are not allowed when Async is enabled')
159+
).rejects.toThrow('Seconds are not allowed in async mode')
160160
})
161161

162162
it('should still execute in-process at the 5-minute boundary', async () => {

apps/sim/executor/handlers/wait/wait-handler.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class WaitBlockHandler implements BlockHandler {
137137
}
138138

139139
if (isAsync && timeUnit === 'seconds') {
140-
throw new Error('Seconds are not allowed when Async is enabled')
140+
throw new Error('Seconds are not allowed in async mode')
141141
}
142142

143143
const waitMs = Math.round(timeValue * UNIT_TO_MS[timeUnit])
@@ -147,7 +147,9 @@ export class WaitBlockHandler implements BlockHandler {
147147
throw new Error('Wait time exceeds maximum of 30 days')
148148
}
149149
} else if (waitMs > MAX_INPROCESS_WAIT_MS) {
150-
throw new Error('Wait time exceeds maximum of 5 minutes; enable Async to wait up to 30 days')
150+
throw new Error(
151+
'Wait time exceeds maximum of 5 minutes; enable async mode to wait up to 30 days'
152+
)
151153
}
152154

153155
if (!isAsync) {

0 commit comments

Comments
 (0)