Skip to main content

Class: HoyoAPIError

Represents an error that can be thrown during interactions with the Hoyolab API.

Hierarchy

  • Error

    HoyoAPIError

Constructors

constructor

new HoyoAPIError(message, code?, http?)

Constructs a new instance of the HoyolabError class with the specified message.

Parameters

NameTypeDescription
messagestringThe message to associate with this error.
code?number-
http?IHTTPError-

Overrides

Error.constructor

Defined in

src/error/error.ts:35

Properties

cause

Optional cause: unknown

Inherited from

Error.cause

Defined in

docs/node_modules/typescript/lib/lib.es2022.error.d.ts:26


code

Optional Readonly code: number

The error code

Defined in

src/error/error.ts:28


http

Optional Readonly http: IHTTPError

The HTTP object

Defined in

src/error/error.ts:23


message

Readonly message: string

The message associated with this error.

Overrides

Error.message

Defined in

src/error/error.ts:18


name

Readonly name: string

The name of this error.

Overrides

Error.name

Defined in

src/error/error.ts:13


stack

Optional stack: string

Inherited from

Error.stack

Defined in

docs/node_modules/typescript/lib/lib.es5.d.ts:1055


prepareStackTrace

Static Optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any

Type declaration

▸ (err, stackTraces): any

Optional override for formatting stack traces

See

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

Parameters
NameType
errError
stackTracesCallSite[]
Returns

any

Inherited from

Error.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:28


stackTraceLimit

Static stackTraceLimit: number

Inherited from

Error.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:30

Methods

captureStackTrace

Static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

NameType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

Error.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:21