ApiError class

A custom error class with categorization.

Constructors

constructor constructor

Signature

(message: string, category: ErrorCategory, code?: string): ApiError

Create an API error.

Parameters

message

Error message

category

The error category

code

Optional error code for machine readability

Properties

category property

readonly

The error category

code property

readonly

Type

string

Optional error code for machine readability

message property

Inherited from Errormessage

Type

string

name property

Inherited from Errorname

Type

string

stack property

Inherited from Errorstack

Type

string