Method EnsureServiceSuccess
EnsureServiceSuccess<T>(NatsMsg<T>, bool)
Throws NatsSvcEndpointException when the response carries a Nats-Service-Error header.
public static NatsMsg<T> EnsureServiceSuccess<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
- NatsMsg<T>
The same message, to allow fluent chaining.
Type Parameters
TMessage payload type.
Exceptions
- NatsSvcEndpointException
Thrown when the response carries a service error.
- NatsNoRespondersException
Thrown when
throwOnNoRespondersistrueand no service responded.