Method IsServiceSuccess
IsServiceSuccess<T>(NatsMsg<T>, bool)
Returns true when the response does not carry a Nats-Service-Error header.
public static bool IsServiceSuccess<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
- bool
trueif the response is a service success; otherwisefalse.
Type Parameters
TMessage payload type.
Exceptions
- NatsNoRespondersException
Thrown when
throwOnNoRespondersistrueand no service responded.