result.setDiagnosticMessage( msg );
if ( e instanceof LdapOperationException)
{
LdapOperationException ne = ( LdapOperationException ) e;
// Add the matchedDN if necessary
boolean setMatchedDn = code == ResultCodeEnum.NO_SUCH_OBJECT || code == ResultCodeEnum.ALIAS_PROBLEM
|| code == ResultCodeEnum.INVALID_DN_SYNTAX || code == ResultCodeEnum.ALIAS_DEREFERENCING_PROBLEM;
if ( ( ne.getResolvedDn() != null ) && setMatchedDn )
{
result.setMatchedDn( (Dn) ne.getResolvedDn() );
}
// Add the referrals if necessary
if ( e instanceof LdapReferralException )
{