文档导航

类:NotFoundError

类:NotFoundError

HTTP 404:资源未找到。

继承

构造函数

构造函数

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

参数

status

number

body

unknown

headers

Headers

message?

string

返回值

NotFoundError

继承自

APIError.constructor

属性

body

readonly body: unknown;

解析后的 JSON、响应文本,或空 body 时为 undefined。

继承自

APIError.body


headers

readonly headers: Headers;

HTTP 响应头。

继承自

APIError.headers


requestId

readonly requestId: string | undefined;

来自 x-typesafe-request-id 的请求 ID,缺失时为 undefined。

继承自

APIError.requestId


status

readonly status: number;

HTTP 响应状态码。

继承自

APIError.status

方法

fromResponse()

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

为某个 HTTP 状态码创建对应的错误子类。

参数

status

number

body

unknown

headers

Headers

返回值

APIError

继承自

APIError.fromResponse