From http://lists.samba.org/archive/samba-technical/2006-August/048878.html:

we had some problems while doing a net ads join (the problem was a wrong 
name resolution setup).
While debugging that, I found that errors given by the ldap library are 
not logged or shown to the user in any way.

I wrote a small patch so that you can see that the ldap connect failed 
instead of just displaying "Operations Error".
It will also output the LDAP server name and port which it was trying to 
connect to.

--- samba-3.0.24/source/libads/ldap.c	2007-02-05 03:59:24.000000000 +0900
+++ samba-3.0.24.osstech/source/libads/ldap.c	2007-04-04 19:23:57.839488507 +0900
@@ -65,6 +65,11 @@ static void gotalarm_sig(void)
                                                                                                                    
 	ldp = ldap_open(server, port);
                                                                                                                    
+	if (ldp == NULL) {
+		DEBUG(2,("Could not open LDAP connection to %s:%d: %s\n",
+			 server, port, strerror(errno)));
+	}
+
 	/* Teardown timeout. */
 	CatchSignal(SIGALRM, SIGNAL_CAST SIG_IGN);
 	alarm(0);
