@142vip.fairy cli.类.FairyHttpError - 142vip/core-x GitHub Wiki

API 参考 / @142vip/fairy-cli / FairyHttpError

类: FairyHttpError

定义于: packages/fairy-cli/src/utils/http.util.ts:6

非 2xx 响应时抛出,携带 status / url / 响应体摘要

theme_extends

  • Error

构造函数

构造函数

new FairyHttpError(status, url, body?): FairyHttpError

定义于: packages/fairy-cli/src/utils/http.util.ts:10

参数

status

number

url

string

body?

string

返回

FairyHttpError

重写了

Error.constructor

属性

cause?

optional cause?: unknown

定义于: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2022.error.d.ts:26

继承自

Error.cause


message

message: string

定义于: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1077

继承自

Error.message


name

name: string

定义于: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1076

继承自

Error.name


stack?

optional stack?: string

定义于: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1078

继承自

Error.stack


status

readonly status: number

定义于: packages/fairy-cli/src/utils/http.util.ts:7


url

readonly url: string

定义于: packages/fairy-cli/src/utils/http.util.ts:8


prepareStackTrace?

static optional prepareStackTrace?: (err, stackTraces) => any

定义于: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:143

Optional override for formatting stack traces

参数

err

Error

stackTraces

CallSite[]

返回

any

参阅

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

继承自

Error.prepareStackTrace


stackTraceLimit

static stackTraceLimit: number

定义于: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:145

继承自

Error.stackTraceLimit

方法

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

定义于: node_modules/.pnpm/@[email protected]/node_modules/@types/node/globals.d.ts:136

Create .stack property on a target object

参数

targetObject

object

constructorOpt?

Function

返回

void

继承自

Error.captureStackTrace


isError()

static isError(error): error is Error

定义于: node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

参数

error

unknown

返回

error is Error

继承自

Error.isError