Skip to content

@jsvision/core / TuiError

Class: TuiError

Defined in: safety/errors.ts:31

Base class for every error the SDK throws. Catch it to handle any SDK error broadly, then narrow to a subclass for the specifics.

Messages are always human-readable and never carry raw keystrokes, pasted text, or other secrets. error.name is set to the concrete subclass name so it reads correctly in stack traces and logs.

Example

ts
import { TuiError, createHost } from '@jsvision/core';

try {
  // ... start the host, run the app ...
} catch (e) {
  if (e instanceof TuiError) {
    console.error(`SDK error (${e.name}): ${e.message}`);
  } else {
    throw e; // not ours — rethrow
  }
}

Extends

  • Error

Extended by

Constructors

Constructor

new TuiError(message): TuiError

Defined in: safety/errors.ts:35

Parameters

message

string

Human-readable description (never carries raw input/secrets).

Returns

TuiError

Overrides

Error.constructor