Skip to content

Commit cda6b74

Browse files
Add longer error description for negative duration (#617)
1 parent 0a55e8e commit cda6b74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/restate-sdk/src/context_impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ export class ContextImpl implements ObjectContext, WorkflowContext {
572572
const millis = millisOrDurationToMillis(duration);
573573
if (millis < 0) {
574574
throw new Error(
575-
`Invalid duration. The sleep function only accepts non-negative values. Received: ${millis}ms.`
575+
`Invalid negative sleep duration: ${millis}ms.\nIf this duration is computed from a desired wake up time, make sure to record 'now' using 'wakeUpTime - ctx.date.now()'.`
576576
);
577577
}
578578
return BigInt(millis);

0 commit comments

Comments
 (0)