Correct exception handling during onConnect\onDisconnect listener invocation