Class ErrorPayload
- Namespace
- NLightning.Bolts.BOLT1.Payloads
- Assembly
- NLightning.Bolts.dll
Represents an error payload.
public class ErrorPayload : IMessagePayload
- Inheritance
-
ErrorPayload
- Implements
- Inherited Members
Remarks
An error payload is used to communicate an error to the other party.
Constructors
ErrorPayload(ChannelId, byte[])
public ErrorPayload(ChannelId channelId, byte[] data)
Parameters
ErrorPayload(ChannelId, string)
public ErrorPayload(ChannelId channelId, string message)
Parameters
ErrorPayload(byte[])
Represents an error payload.
public ErrorPayload(byte[] data)
Parameters
data
byte[]The error data.
Remarks
An error payload is used to communicate an error to the other party.
- See Also
ErrorPayload(string)
public ErrorPayload(string message)
Parameters
message
string
Properties
ChannelId
The channel id.
public ChannelId ChannelId { get; }
Property Value
Remarks
The channel id is used to identify the channel the error is related to.
Data
The error data.
public byte[]? Data { get; }
Property Value
- byte[]
Remarks
The error data is used to communicate the error.
Methods
DeserializeAsync(Stream)
Deserialize an ErrorPayload from a stream.
public static Task<ErrorPayload> DeserializeAsync(Stream stream)
Parameters
stream
StreamThe stream to deserialize from.
Returns
- Task<ErrorPayload>
The deserialized ErrorPayload.
Exceptions
- PayloadSerializationException
Error deserializing Payload
SerializeAsync(Stream)
Serializes the message payload to a stream.
public Task SerializeAsync(Stream stream)
Parameters
stream
StreamThe stream to serialize to.
Returns
- Task
A task that represents the asynchronous operation.