このページの翻訳はまだありません。英語版を表示しています。

TaffyError

Error class thrown when a Taffy operation fails, containing a human-readable error message.

This class wraps the native [taffy::TaffyError] type and exposes it to JavaScript with a readable error message. It is thrown as a JavaScript exception on failure.

Example

try { const tree = new TaffyTree(); const node = tree.newLeaf(new Style()); tree.remove(node); } catch (e) { if (e instanceof TaffyError) { console.error(e.message); } }

Remarks

The underlying Taffy errors include:

  • InvalidInputNode: Node ID doesn't exist in the tree
  • InvalidParentNode: Specified parent node doesn't exist
  • ChildIndexOutOfBounds: Child index exceeds available children

Properties

PropertyModifierTypeDescription
messagereadonlystringGets the human-readable error message Remarks Examples: - "Node with id 1234 is not present in the Taffy tree" - "Index 5 is out of bounds for node with 3 children"

Methods

[dispose]()

dispose: void;

Returns

void


free()

free(): void;

Returns

void

© 2026 ByteLand Technology Limited