Skip to the content

Houseki宝石

Run five native gem and stone engines, play measured challenges and lessons, and save deterministic games.

Houseki (宝石) is Japanese for a gem or precious stone. About the name

Contents

Reference · Gem Swap

GemSwapOptionsErrorclass

Typed error for invalid settings or a board that cannot be generated safely.

Import it

import { GemSwapOptionsError } from "@johnmorrisdotca/houseki/gem-swap";

Definition

class GemSwapOptionsError
new GemSwapOptionsError(code: string, message: string): GemSwapOptionsError

Parameters

NameTypeDescription
codestring

The native stable error code used by callers to distinguish setup or replay failures.

messagestring

The human-readable diagnostic accompanying the native code.

Members

NameTypeDescription
codestring
namestring
messagestring
stack (optional)string | undefined
cause (optional)unknown

Examples

import { GemSwapOptionsError } from "@johnmorrisdotca/houseki/gem-swap";

const error=new GemSwapOptionsError("docs-example","Invalid example setup");
console.log(error.name,error.code,error.message);
GemSwapOptionsError docs-example Invalid example setup

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/houseki 0.4.2.