API reference@evolu/commonAssert › assertNotAborted

Call Signature

function assertNotAborted<T>(
  result: Result<T, AbortError>,
  message?: string,
): asserts result is Ok<T>;

Defined in: packages/common/src/Assert.ts:122

Asserts that a Result did not fail with AbortError.

Use when abort would indicate a programmer error rather than ordinary control flow.

In general, abort is normal control flow. Stopping work and returning AbortError is the correct behavior when a Run or Fiber is cancelled.

Use assertNotAborted only to protect invariants in code that has already decided abort must not happen, such as resource helpers built on unabortable. In those places it helps fail fast on mistakes, because TypeScript cannot fully enforce that lifecycle logic is correct.

Call Signature

function assertNotAborted<T, E>(
  result: Result<T, AbortError | E>,
  message?: string,
): asserts result is Result<T, E>;

Defined in: packages/common/src/Assert.ts:126

Asserts that a Result did not fail with AbortError.

Use when abort would indicate a programmer error rather than ordinary control flow.

In general, abort is normal control flow. Stopping work and returning AbortError is the correct behavior when a Run or Fiber is cancelled.

Use assertNotAborted only to protect invariants in code that has already decided abort must not happen, such as resource helpers built on unabortable. In those places it helps fail fast on mistakes, because TypeScript cannot fully enforce that lifecycle logic is correct.