class RemoteError
extends TrellisError<RemoteErrorData>

Error for wrapping errors received from remote Trellis services. This is the only error type with parseJSON/parseObject methods for deserializing remote errors.

Constructors

RemoteError(options:
ErrorOptions
& { error: TransportableTrellisErrorData; context?: Record<string, unknown>; id?: string; }
)

Static Properties

Alias for parse() - parses JSON string or object as TrellisErrorData.

Static Methods

parse(data: unknown): Result<
TransportableTrellisErrorData,
>

Parses and validates a plain object as TrellisErrorData. Use this to deserialize errors received from remote services.

Properties

readonly
name: "RemoteError"
readonly
remoteError: TransportableTrellisErrorData

Methods

toSerializable(): RemoteErrorData

Serializes error to a plain object.