Class NatsSvcMsgExtensions
Extension helpers for inspecting service responses on the requester side.
public static class NatsSvcMsgExtensions
- Inheritance
-
NatsSvcMsgExtensions
- Inherited Members
Remarks
Service handlers signal errors using the Nats-Service-Error and
Nats-Service-Error-Code response headers (see
ReplyErrorAsync(int, string, NatsHeaders?, string?, NatsPubOpts?, CancellationToken)).
These helpers surface that convention on the request side.
Methods
- EnsureServiceSuccess<T>(NatsMsg<T>, bool)
Throws NatsSvcEndpointException when the response carries a
Nats-Service-Errorheader.
- GetServiceStatus<T>(NatsMsg<T>, bool)
Reads the service status from the response, combining the
Nats-Service-Error/Nats-Service-Error-Codeheaders with the no-responders sentinel.
- IsServiceSuccess<T>(NatsMsg<T>, bool)
Returns
truewhen the response does not carry aNats-Service-Errorheader.