Table of Contents

Method IsServiceSuccess

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

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

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

bool

true if the response is a service success; otherwise false.

Type Parameters

T

Message payload type.

Exceptions

NatsNoRespondersException

Thrown when throwOnNoResponders is true and no service responded.