Skip to content

@jsvision/core / EssentialsNotMetError

Class: EssentialsNotMetError ​

Defined in: safety/errors.ts:59

Thrown when the terminal does not meet the SDK's runtime essentials, so the app must not start. The unmet essentials are listed in missing and in the message.

Example ​

ts
import { assertEssentials, EssentialsNotMetError, resolveCapabilities, detectTty } from '@jsvision/core';

try {
  assertEssentials(resolveCapabilities().profile, { isTTY: detectTty() });
} catch (e) {
  if (e instanceof EssentialsNotMetError) {
    console.error(`Cannot start: ${e.missing.join(', ')}`);
    process.exit(1);
  }
  throw e;
}

Extends ​

Constructors ​

Constructor ​

new EssentialsNotMetError(missing): EssentialsNotMetError

Defined in: safety/errors.ts:66

Parameters ​

missing ​

readonly string[]

The unmet essential(s); included in the message verbatim.

Returns ​

EssentialsNotMetError

Overrides ​

TuiError.constructor

Properties ​

missing ​

readonly missing: readonly string[]

Defined in: safety/errors.ts:61

The unmet essential(s), e.g. ['interactive TTY (raw-mode keyboard input)'].