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
Name | Type | Description |
---|---|---|
message | string | The message to associate with this error. |
code? | number | - |
http? | IHTTPError | - |
Overrides
Error.constructor
Defined in
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
http
• Optional
Readonly
http: IHTTPError
The HTTP object
Defined in
message
• Readonly
message: string
The message associated with this error.
Overrides
Error.message
Defined in
name
• Readonly
name: string
The name of this error.
Overrides
Error.name
Defined in
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
Name | Type |
---|---|
err | Error |
stackTraces | CallSite [] |
Returns
any
Inherited from
Error.prepareStackTrace
Defined in
node_modules/@types/node/globals.d.ts:11
stackTraceLimit
▪ Static
stackTraceLimit: number
Inherited from
Error.stackTraceLimit
Defined in
node_modules/@types/node/globals.d.ts:13
Methods
captureStackTrace
▸ Static
captureStackTrace(targetObject
, constructorOpt?
): void
Create .stack property on a target object
Parameters
Name | Type |
---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
Error.captureStackTrace
Defined in
node_modules/@types/node/globals.d.ts:4