ElementSourceErrorクラス
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Why a source could not be used: the address was refused before any request, the source answered something other than 200 (and will not be asked again for a while), the answer was too big, or it could not be read.
インポート
import { ElementSourceError } from "@johnmorrisdotca/chikyu-earth/satellites";
定義
class ElementSourceError
new ElementSourceError(message: string, details?: { status?: number; retryAt?: number; }): ElementSourceError
引数
| 名前 | 型 | 説明 |
|---|---|---|
message | string | What went wrong, in a sentence. |
details (省略可) | { status?: number; retryAt?: number; } | The HTTP status the source answered and when it may be asked again, when they are known. |
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
status | number | undefined | The HTTP status the source answered, when it answered. |
retryAt | number | undefined | When, in milliseconds since the Unix epoch, the source may be asked again (it is not asked before). |
name | string | |
message | string | |
stack (省略可) | string | undefined | |
cause (省略可) | unknown |
例
import { ElementSourceError } from "@johnmorrisdotca/chikyu-earth/satellites";
const error = new ElementSourceError("refused", { status: 403 });
console.log(error.status);403出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。