GenerationErrorクラス
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A bounded generator must say it failed, never quietly return a guessing board.
インポート
import { GenerationError } from "@johnmorrisdotca/jirai";
定義
class GenerationError
new GenerationError(code: "settings" | "opening" | "exhausted", message: string): GenerationError
引数
| 名前 | 型 | 説明 |
|---|---|---|
code | "opening" | "settings" | "exhausted" | settings for invalid input, opening for an impossible safe opening, or exhausted for a spent generation budget. |
message | string | The readable reason for generation failure. |
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
code | "opening" | "settings" | "exhausted" | |
name | string | |
message | string | |
stack (省略可) | string | undefined | |
cause (省略可) | unknown |
例
import { GenerationError } from "@johnmorrisdotca/jirai";
const error=new GenerationError("exhausted","No proved field within this budget");
console.log(error.code,error.message);exhausted No proved field within this budget出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。