API reference@evolu/commonTask › AbortError

const AbortError: typed("AbortError", {
  reason: AbortReason,
});

Defined in: packages/common/src/Task.ts:1797

Typed object representing structured-concurrency abort control flow.

AbortError is thrown to stop Task execution when a Run observes an abort request. AbortableFiber catches AbortError and returns it as a Result error, so abort can be handled as an ordinary Task outcome.

The reason explains why the Run was aborted. It can be an explicit abort reason, runDisposedAbortReason for normal Run cleanup, or PanicAbortReason when a defect panicked the Run tree. The original defect is available as panicAbortReason.defect for diagnostics.

AbortError is reserved for Task abort control flow. Do not throw or reject with AbortError for domain errors; return a Result error instead.

Helpers that abort their own child Tasks should catch or normalize AbortError before it escapes the helper boundary. The reason carries typed domain data.

WebKit fetch rejects with its own abort error instead of signal.reason. Native wrappers should treat signal.reason as the source of truth and normalize aborts to AbortError.