Some tests fail randomly with error test is not expecting. We think its timing related as Sender always tries to reconnect every few seconds, and retries changes the error returned by Sender.
To avoid this, best for Sender is send consistent error when socket is not connected and Log the real error along with returning it to client as extra info.