You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2006/08/28 17:28:34 UTC

svn commit: r437727 - /directory/branches/shared/0.9.5/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestGrammar.java

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 );
                         }
                     }