Skip to content
IC Reactor

ApiError

Defined in: core/src/errors/index.ts:103

The shape of an API error record: a code, a message and details, such as Orbit’s record { code : text; message : opt text; details : opt vec record { text; text } }.

message and details are unknown unless given, because decoding decides their types: that record gives [] | [string] and [] | [Array<[string, string]>] through a Reactor, and string | null | undefined and Record<string, string> | null | undefined through a DisplayReactor. Neither is ever a Map. Name them for an error type you know, e.g. ApiError<[] | [string], [] | [Array<[string, string]>]>.

Message = unknown

The type of message

Details = unknown

The type of details

code: string

Defined in: core/src/errors/index.ts:104


message: Message

Defined in: core/src/errors/index.ts:105


details: Details

Defined in: core/src/errors/index.ts:106