Class NatsyServerException

  • All Implemented Interfaces:
    java.io.Serializable

    
    public class NatsyServerException
    extends NatsyException
                        

    The NATS server rejected the operation.

    open rather than sealed: it is both the fallback for API errors natsy does not classify and the base of the two that it does, so catch (e: NatsyServerException) means "the server said no" regardless of which.

    • Method Detail

      • getErrorCode

         final Integer getErrorCode()

        the transport-level code jnats reports - 400, 404, 503

      • getApiErrorCode

         final Integer getApiErrorCode()

        the JetStream API code, e.g. 10014 (consumer not found) or 10071 (wrong last sequence). -1 when the server did not send one.