Skip to main content

Class: Failure

A general purpose failure message. See: https://github.com/nexus-rpc/api/blob/main/SPEC.md#failure

Properties​

cause?​

optional cause?: $Properties | null

Failure cause.


details​

details: Uint8Array

UTF-8 encoded JSON serializable details.


message​

message: string

Failure message.


metadata​

metadata: object

Failure metadata.

Index Signature​

[k: string]: string


stackTrace​

stackTrace: string

Failure stackTrace.

Methods​

toJSON()​

toJSON(): object

Converts this Failure to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): Failure & $Properties

Creates a new Failure instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

Failure & $Properties

Failure instance

Call Signature​

static create(properties?): Failure

Creates a new Failure instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

Failure

Failure instance


decode()​

static decode(reader, length?): Failure & $Properties

Decodes a Failure message from the specified reader or buffer.

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

length?​

number

Message length if known beforehand

Returns​

Failure & $Properties

Failure

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): Failure & $Properties

Decodes a Failure message from the specified reader or buffer, length delimited.

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

Returns​

Failure & $Properties

Failure

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


encode()​

static encode(message, writer?): Writer

Encodes the specified Failure message. Does not implicitly temporal.api.nexus.v1.Failure.verify|verify messages.

Parameters​

message​

$Properties

Failure message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

Encodes the specified Failure message, length delimited. Does not implicitly temporal.api.nexus.v1.Failure.verify|verify messages.

Parameters​

message​

$Properties

Failure message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): Failure

Creates a Failure message from a plain object. Also converts values to their respective internal types.

Parameters​

object​

Plain object

Returns​

Failure

Failure


toObject()​

static toObject(message, options?): object

Creates a plain object from a Failure message. Also converts values to other types if specified.

Parameters​

message​

Failure

Failure

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object