Skip to content

Task Failure

1 min read

Import: import system.task;

Read the structured concurrency guide for lifetimes, cancellation, backpressure, and worker execution.

TaskFailure

Preserves application errors while distinguishing structured cancellation and deadlines.

public enum TaskFailure<E>

Failed

A child or the scope body returned an application error.

Failed(E)

Cancelled

The parent or caller requested cancellation.

Cancelled

TimedOut

The scope deadline expired before all work completed.

TimedOut

WorkerFailed

A worker rejected a submitted job or crashed before replying; the error says which.

WorkerFailed(TaskPoolError)

InvalidOperation

A concurrency limit or scope operation was invalid.

InvalidOperation