Method GetServiceStatus
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
msgNatsMsg<T>The response message to inspect.
throwOnNoRespondersboolWhen
true(the default), throws NatsNoRespondersException if the response is a no-responders sentinel.
Returns
- NatsSvcStatus
The parsed NatsSvcStatus.
Type Parameters
TMessage 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
throwOnNoRespondersistrueand no service responded.