ドキュメント

クラス:APIError

クラス:APIError

API からの成功しなかった HTTP 応答。

継承元

継承先

コンストラクター

コンストラクター

new APIError(
   status,
   body,
   headers,
   message?
): APIError;

パラメーター

status

number

body

unknown

headers

Headers

message?

string

戻り値

APIError

オーバーライド

TypeSafeError.constructor

プロパティ

body

readonly body: unknown;

パースされた JSON、応答テキスト、本文が空の場合は undefined。


headers

readonly headers: Headers;

HTTP 応答ヘッダー。


requestId

readonly requestId: string | undefined;

x-typesafe-request-id からのリクエスト ID。存在しない場合は undefined。


status

readonly status: number;

HTTP 応答のステータスコード。

メソッド

fromResponse()

static fromResponse(
   status,
   body,
   headers
): APIError;

HTTP ステータスコードに対応するエラーのサブクラスを作成します。

パラメーター

status

number

body

unknown

headers

Headers

戻り値

APIError