Function: failTask()
failTask(
ctx,taskId,attempt,error,retryable?,cause?,usage?):Promise<TaskResult>
Defined in: sdk/ts/sdk/src/host/worker/complete.ts:65
Records an attempt's failure: a retrying event when retryable and the kernel's retry plan allows another attempt, otherwise a failed event. The first terminal result for an attempt wins; later ones return duplicate: true.
cause names who lost the attempt: the handler by default, the reaper on a dead lease. usage is banked whichever way the attempt ends — tokens burned before a throw are spent.
Parameters
ctx
taskId
string
attempt
number
error
string
retryable?
boolean = true
cause?
Cause = "app_error"
usage?
Returns
Promise<TaskResult>
Throws
TaskNotFound when no task has that id.