type alias RunFailure

Every way a run can fail to happen: an option the runner will not accept, an unreadable input, a directory with no package.json above it, an esbuild plugin that will not load.

Note what is not here. Failing tests are not a failure — they are a RunResult with ok: false. This union is only for the runner being unable to answer the question.

import { Failure } from '../task/index.ts';

// Defined, not invoked: a real failure comes back from `run(...).result()`.
function explain(failure: RunFailure) {
  return `${failure.code}: ${Failure.format(failure)}`; // 'InvalidFlag: …'
}

Definition

ConfigFailure | InvalidOptionFailure

Usage

import { type RunFailure } from "lib/api/index.ts";