Class: Failure
A general purpose failure message. See: https://github.com/nexus-rpc/api/blob/main/SPEC.md#failure
Implements
Constructors
constructor
• new Failure(properties?
): Failure
Constructs a new Failure.
Parameters
Name | Type | Description |
---|---|---|
properties? | IFailure | Properties to set |
Returns
Properties
details
• details: Uint8Array
Failure details.
Implementation of
message
• message: string
Failure message.
Implementation of
metadata
• metadata: Object
Failure metadata.
Index signature
▪ [k: string
]: string
Implementation of
Methods
toJSON
▸ toJSON(): Object
Converts this Failure to JSON.
Returns
Object
JSON object
create
▸ create(properties?
): Failure
Creates a new Failure instance using the specified properties.
Parameters
Name | Type | Description |
---|---|---|
properties? | IFailure | Properties to set |
Returns
Failure instance
decode
▸ decode(reader
, length?
): Failure
Decodes a Failure message from the specified reader or buffer.
Parameters
Name | Type | Description |
---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
length? | number | Message length if known beforehand |