You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Felix Knecht <fe...@otego.com> on 2010/06/07 16:43:48 UTC

Exception to be or not to be?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Should an exception be thrown or not?

public final void modify( ModifyOperationContext modifyContext ) throws
LdapException
{
    try
    {
        Entry modifiedEntry = store.modify( modifyContext.getDn(),
modifyContext.getModItems() );
        modifyContext.setAlteredEntry( modifiedEntry );
    }
    catch ( Exception e )
    {
    }
}


http://people.apache.org/~felixk/apacheds-docs/xref/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.html#303
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEUEARECAAYFAkwNBaQACgkQ2lZVCB08qHEMagCUCGVYrVZxQtcjdGgSlk8sC8Q+
GQCeJUYwcfthbgFgYTO8zjdGAF/zuE4=
=B1iQ
-----END PGP SIGNATURE-----

Re: Exception to be or not to be?

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 6/7/10 4:43 PM, Felix Knecht wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Should an exception be thrown or not?
>    

Sure we must !!!

> public final void modify( ModifyOperationContext modifyContext ) throws
> LdapException
> {
>      try
>      {
>          Entry modifiedEntry = store.modify( modifyContext.getDn(),
> modifyContext.getModItems() );
>          modifyContext.setAlteredEntry( modifiedEntry );
>      }
>      catch ( Exception e )
>      {
>    
Bad bad bad ! throw new DirtyCodeException( "Yuuuk !!" );
>      }
> }
>    

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.nextury.com