directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r771479 - /directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
Date Mon, 04 May 2009 22:36:32 GMT
Author: elecharny
Date: Mon May  4 22:36:32 2009
New Revision: 771479

URL: http://svn.apache.org/viewvc?rev=771479&view=rev
Log:
Handle exception thron by MINA

Modified:
    directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java

Modified: directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java?rev=771479&r1=771478&r2=771479&view=diff
==============================================================================
--- directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
(original)
+++ directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
Mon May  4 22:36:32 2009
@@ -101,6 +101,7 @@
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.mina.core.filterchain.IoFilter;
 import org.apache.mina.core.future.ConnectFuture;
+import org.apache.mina.core.future.WriteFuture;
 import org.apache.mina.core.service.IoConnector;
 import org.apache.mina.core.service.IoHandlerAdapter;
 import org.apache.mina.core.session.IoSession;
@@ -266,7 +267,19 @@
 
         try
         {
-            ldapSession.write( request );
+            WriteFuture writeFuture = ldapSession.write( request );
+            
+            if ( writeFuture.getException() != null )
+            {
+                String message = "We have got an exception while writing the request : "
+ 
+                    writeFuture.getException().getMessage();
+                LOG.error( message );
+                LdapException ldapException = 
+                    new LdapException( message );
+                ldapException.initCause( writeFuture.getException() );
+                
+                throw ldapException;
+            }
         }
         finally
         {



Mime
View raw message