From 8f3f24fbdfdb5eda119e3ff12816ad452766a10e Mon Sep 17 00:00:00 2001 From: slinkydeveloper Date: Mon, 3 Nov 2025 18:00:58 +0100 Subject: [PATCH] Add longer error description for negative duration --- packages/restate-sdk/src/context_impl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/restate-sdk/src/context_impl.ts b/packages/restate-sdk/src/context_impl.ts index 50a6eb99..bd885ec0 100644 --- a/packages/restate-sdk/src/context_impl.ts +++ b/packages/restate-sdk/src/context_impl.ts @@ -572,7 +572,7 @@ export class ContextImpl implements ObjectContext, WorkflowContext { const millis = millisOrDurationToMillis(duration); if (millis < 0) { throw new Error( - `Invalid duration. The sleep function only accepts non-negative values. Received: ${millis}ms.` + `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()'.` ); } return BigInt(millis);