Table of Contents

Method GetServiceStatus

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

GetServiceStatus<T>(NatsMsg<T>, bool)

Reads the service status from the response, combining the Nats-Service-Error / Nats-Service-Error-Code headers with the no-responders sentinel.

public static NatsSvcStatus GetServiceStatus<T>(this NatsMsg<T> msg, bool throwOnNoResponders = true)

Parameters

msg NatsMsg<T>

The response message to inspect.

throwOnNoResponders bool

When true (the default), throws NatsNoRespondersException if the response is a no-responders sentinel.

Returns

NatsSvcStatus

The parsed NatsSvcStatus.

Type Parameters

T

Message payload type.

Remarks

When a header is present multiple times (e.g. a reply that emitted the header line more than once), the last value wins.

Exceptions

NatsNoRespondersException

Thrown when throwOnNoResponders is true and no service responded.