Skip to content

Class: FanbookApiError

Fanbook API 请求错误。

Extends

  • Error

Constructors

new FanbookApiError()

new FanbookApiError(code?, description?, request?, response?, error?): FanbookApiError

Parameters

ParameterTypeDescription
code?number错误码。
description?string错误信息。
request?AxiosRequestConfig<any>请求对象。
response?AxiosResponse<any, any>响应对象。
error?unknownaxios 抛出的错误。

Returns

FanbookApiError

Overrides

Error.constructor

Defined in

src/error.ts:5

Properties

code?

optional code: number

错误码。

Defined in

src/error.ts:7


description?

optional description: string

错误信息。

Defined in

src/error.ts:9


error?

optional error: unknown

axios 抛出的错误。

Defined in

src/error.ts:15


message

message: string

Inherited from

Error.message

Defined in

node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.es5.d.ts:1077


name

name: string

Inherited from

Error.name

Defined in

node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.es5.d.ts:1076


request?

optional request: AxiosRequestConfig<any>

请求对象。

Defined in

src/error.ts:11


response?

optional response: AxiosResponse<any, any>

响应对象。

Defined in

src/error.ts:13


stack?

optional stack: string

Inherited from

Error.stack

Defined in

node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.es5.d.ts:1078


prepareStackTrace()?

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

Optional override for formatting stack traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

See

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

Inherited from

Error.prepareStackTrace

Defined in

node_modules/.pnpm/@types+node@20.11.28/node_modules/@types/node/globals.d.ts:28


stackTraceLimit

static stackTraceLimit: number

Inherited from

Error.stackTraceLimit

Defined in

node_modules/.pnpm/@types+node@20.11.28/node_modules/@types/node/globals.d.ts:30

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

Error.captureStackTrace

Defined in

node_modules/.pnpm/@types+node@20.11.28/node_modules/@types/node/globals.d.ts:21

Released under the MIT License.