When I connect an initiator to a FIX server using SSL via the initiator.start() method, it fires up a separate thread to establish the connection. Now when this fails e.g. due to an SSL handshake issue or an issue with server connectivity, the error is thrown out to the logs but can't seemingly be trapped in code and managed. How can I detect/trap when the error happens?
Disconnecting: Socket exception (<server ip>): java.net.SocketException: Connection reset.
At the bottom of the stack trace is the threadpool executor.
I have a try-catch around the start method but as the exception happens in another thread it can't catch it.