类:AuthenticationError
HTTP 401:身份验证失败。
继承自
构造函数
构造函数
new AuthenticationError(
status,
body,
headers,
message?
): AuthenticationError;
参数
status
number
body
unknown
headers
Headers
message?
string
返回
AuthenticationError
继承自
属性
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