File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ export type HandleErrorResult =
127127
128128export type HandleErrorArgs = {
129129 ctx : Context ;
130+ init : unknown ;
130131 retry ?: RetryOptions ;
131132 retryAt ?: Date ;
132133 retryDelayInMs ?: number ;
@@ -152,9 +153,9 @@ type CommonTaskOptions<
152153 /** The retry settings when an uncaught error is thrown.
153154 *
154155 * If omitted it will use the values in your `trigger.config.ts` file.
155- *
156+ *
156157 * @example
157- *
158+ *
158159 * ```
159160 * export const taskWithRetries = task({
160161 id: "task-with-retries",
@@ -174,10 +175,10 @@ type CommonTaskOptions<
174175 retry ?: RetryOptions ;
175176
176177 /** Used to configure what should happen when more than one run is triggered at the same time.
177- *
178- * @example
178+ *
179+ * @example
179180 * one at a time execution
180- *
181+ *
181182 * ```ts
182183 * export const oneAtATime = task({
183184 id: "one-at-a-time",
@@ -192,9 +193,9 @@ type CommonTaskOptions<
192193 */
193194 queue ?: QueueOptions ;
194195 /** Configure the spec of the machine you want your task to run on.
195- *
196+ *
196197 * @example
197- *
198+ *
198199 * ```ts
199200 * export const heavyTask = task({
200201 id: "heavy-task",
Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ export class TaskExecutor {
176176 runError ,
177177 parsedPayload ,
178178 ctx ,
179+ initOutput ,
179180 signal
180181 ) ;
181182
@@ -498,6 +499,7 @@ export class TaskExecutor {
498499 error : unknown ,
499500 payload : any ,
500501 ctx : TaskRunContext ,
502+ init : unknown ,
501503 signal ?: AbortSignal
502504 ) : Promise <
503505 | { status : "retry" ; retry : TaskRunExecutionRetry ; error ?: unknown }
@@ -550,6 +552,7 @@ export class TaskExecutor {
550552 const handleErrorResult = this . task . fns . handleError
551553 ? await this . task . fns . handleError ( payload , error , {
552554 ctx,
555+ init,
553556 retry,
554557 retryDelayInMs : delay ,
555558 retryAt : delay ? new Date ( Date . now ( ) + delay ) : undefined ,
@@ -558,6 +561,7 @@ export class TaskExecutor {
558561 : this . _importedConfig
559562 ? await this . _handleErrorFn ?.( payload , error , {
560563 ctx,
564+ init,
561565 retry,
562566 retryDelayInMs : delay ,
563567 retryAt : delay ? new Date ( Date . now ( ) + delay ) : undefined ,
You can’t perform that action at this time.
0 commit comments