Better identify JetStream connection and /communication errors.
Versions of io.nats:jnats and nats-server:
io.nats:jnats: 2.16.1
nats-server: 2.8.4
OS/Container environment:
Client: Windows 10
Server: alpine docker image
Steps or code to reproduce the issue:
- Start a nats-server with default configuration and no streams configured
- Publish a JetStream message
natsConn.jetStream().publish("test", myMessageBytes)
Expected result:
The publish function throws a JetStreamApiException with the right error code.
Actual result:
The publish function throws an IOException
https://github.com/nats-io/nats.java/blob/main/src/main/java/io/nats/client/impl/NatsJetStream.java#L153