directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1496645 - /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
Date Tue, 25 Jun 2013 21:46:00 GMT
Author: elecharny
Date: Tue Jun 25 21:46:00 2013
New Revision: 1496645

URL: http://svn.apache.org/r1496645
Log:
Keep the stackTrace in the message when the errorCode is OTHER

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java?rev=1496645&r1=1496644&r2=1496645&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
Tue Jun 25 21:46:00 2013
@@ -35,7 +35,6 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.api.ldap.model.message.ResultResponse;
 import org.apache.directory.api.ldap.model.message.ResultResponseRequest;
-import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.ldap.LdapServer;
@@ -243,6 +242,7 @@ public abstract class LdapRequestHandler
          * Set the result code or guess the best option.
          */
         ResultCodeEnum code;
+
         if ( e instanceof LdapOperationException )
         {
             code = ( ( LdapOperationException ) e ).getResultCode();
@@ -261,10 +261,10 @@ public abstract class LdapRequestHandler
          */
         String msg = code.toString() + ": failed for " + req + ": " + e.getLocalizedMessage();
 
-        if ( LOG.isDebugEnabled() )
-        {
-            LOG.debug( msg, e );
+        LOG.debug( msg, e );
 
+        if ( LOG.isDebugEnabled() || ( code == ResultCodeEnum.OTHER ) )
+        {
             msg += ":\n" + ExceptionUtils.getStackTrace( e );
         }
 
@@ -280,7 +280,7 @@ public abstract class LdapRequestHandler
 
             if ( ( ne.getResolvedDn() != null ) && setMatchedDn )
             {
-                result.setMatchedDn( ( Dn ) ne.getResolvedDn() );
+                result.setMatchedDn( ne.getResolvedDn() );
             }
 
             // Add the referrals if necessary



Mime
View raw message