Skip to content

Aborted

Aborted = WithKind<"Aborted"> & object

Defined in: Core/Aborted.ts:24

Describes an operation that stopped because its caller cancelled it.

Every cancellable engine settles with the same Aborted shape, so a single kind === "Aborted" check handles cancellation from Graph, Transaction, and Batcher. The reason is whatever was passed to AbortSignal.abort(reason).

readonly reason: unknown

The value passed to AbortSignal.abort(reason), or undefined when no reason was supplied.

import { Aborted, pipe, Result } from "@pplnd/core";

const outcome = pipe(
  await runReport(signal),
  Result.mapError((error) => error),
);

if (Result.is.err(outcome) && Aborted.is(outcome.error)) {
  console.log("Report cancelled:", outcome.error.reason);
}