Table of Contents

Method ReplyErrorAsync

Namespace
NATS.Client.Services
Assembly
NATS.Client.Services.dll

ReplyErrorAsync<TReply>(int, string, TReply, NatsHeaders?, string?, INatsSerialize<TReply>?, NatsPubOpts?, CancellationToken)

Reply with an error and additional data as error body.

public ValueTask ReplyErrorAsync<TReply>(int code, string message, TReply data, NatsHeaders? headers = null, string? replyTo = null, INatsSerialize<TReply>? serializer = null, NatsPubOpts? opts = null, CancellationToken cancellationToken = default)

Parameters

code int

Error code.

message string

Error message.

data TReply

Error body.

headers NatsHeaders

Optional additional headers.

replyTo string

Optional reply-to subject.

serializer INatsSerialize<TReply>

Serializer to use for the message type.

opts NatsPubOpts

Optional publishing options.

cancellationToken CancellationToken

A CancellationToken used to cancel the API call.

Returns

ValueTask

A ValueTask representing the asynchronous operation.

Type Parameters

TReply

A serializable type as data.

ReplyErrorAsync(int, string, NatsHeaders?, string?, NatsPubOpts?, CancellationToken)

Reply with an error.

public ValueTask ReplyErrorAsync(int code, string message, NatsHeaders? headers = null, string? replyTo = null, NatsPubOpts? opts = null, CancellationToken cancellationToken = default)

Parameters

code int

Error code.

message string

Error message.

headers NatsHeaders

Optional additional headers.

replyTo string

Optional reply-to subject.

opts NatsPubOpts

Optional publishing options.

cancellationToken CancellationToken

A CancellationToken used to cancel the API call.

Returns

ValueTask

A ValueTask representing the asynchronous operation.