标准化响应数据的类型。
标准化响应数据的类型。
已完成请求的标准化网络响应。
可选causeSDK 公共请求配置快照;可能含原始 URL、请求头或请求数据,记录日志前必须自行脱敏。
标准化响应数据;类型由 network.request<T>() 的泛型参数决定。
标准化响应头;敏感响应头会在进入错误对象前被脱敏或移除。
完整标准化响应,包含状态、头、数据和请求配置。
可选stackHTTP 状态码;由 validateStatus 判定为失败的响应状态。
静态stackThe Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
静态captureCreates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
可选constructorOpt: Function静态isIndicates whether the argument provided is a built-in Error instance or not.
静态prepare
SDK 对外抛出的 HTTP 错误类型。
备注
仅在请求已经成功走完 bridge / runtime / 宿主调用链、但最终 HTTP 状态不满足
validateStatus时抛出。它不表示握手失败或 bridge 级错误。网络请求没有收到 可判定的 HTTP 响应时,SDK 会抛出HbMiniProgramSDKError或原始 transport 错误, 不应把本类当作网络不可达的统一错误类型。