directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r437727 - /directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java
Date Mon, 28 Aug 2006 15:28:34 GMT
Author: elecharny
Date: Mon Aug 28 08:28:34 2006
New Revision: 437727

URL: http://svn.apache.org/viewvc?rev=437727&view=rev
Log:
Fixed the throwed exceptions to fix DIRSERVER-711

Modified:
    directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java

Modified: directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java?rev=437727&r1=437726&r2=437727&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java
(original)
+++ directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java
Mon Aug 28 08:28:34 2006
@@ -275,6 +275,8 @@
                         String msg = "Invalid operation ( " + StringTools.dumpBytes( tlv.getValue().getData()
)
                             + "), it should be 0, 1 or 2";
                         log.error( msg );
+                        
+                        // This will generate a PROTOCOL_ERROR
                         throw new DecoderException( msg );
                     }
 
@@ -347,7 +349,11 @@
 
                     if ( tlv.getLength().getLength() == 0 )
                     {
-                        throw new DecoderException( "The type can't be null" );
+                        String msg = "The type can't be null";
+                        log.error( msg );
+                        
+                        ModifyResponseImpl response = new ModifyResponseImpl( ldapMessage.getMessageId()
);
+                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDATTRIBUTESYNTAX,
modifyRequest.getObject(), null );
                     }
                     else
                     {
@@ -358,8 +364,11 @@
                         }
                         catch ( LdapStringEncodingException lsee )
                         {
-                            log.error( "Invalid type : {}", StringTools.dumpBytes( tlv.getValue().getData()
) );
-                            throw new DecoderException( "Invalid type : " + lsee.getMessage()
);
+                            String msg = "Invalid type : " + StringTools.dumpBytes( tlv.getValue().getData()
);
+                            log.error( msg );
+
+                            ModifyResponseImpl response = new ModifyResponseImpl( ldapMessage.getMessageId()
);
+                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDATTRIBUTESYNTAX,
modifyRequest.getObject(), lsee );
                         }
                     }
 



Mime
View raw message