directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (DIRSERVER-649) transport explanations in NamingExceptions why searches fail back to the client
Date Thu, 14 May 2009 17:26:45 GMT

     [ https://issues.apache.org/jira/browse/DIRSERVER-649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Emmanuel Lecharny resolved DIRSERVER-649.
-----------------------------------------

    Resolution: Fixed

This long witing issue has been fixed. We now transmit the initial cause to the client, and
if the server is in debug mode, we also transmit the stack trace.

> transport explanations in NamingExceptions why searches fail back to the client
> -------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-649
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-649
>             Project: Directory ApacheDS
>          Issue Type: Improvement
>          Components: ldap
>         Environment: all
>            Reporter: Ralf Hauser
>             Fix For: 1.5.5
>
>         Attachments: SearchHandler.java.patch
>
>
> Our ldap application has a custom partition and we only allow restricted searches on
it.
> If the queries do not comply with our rules, we throw a NamingException.
> I guess good candidates for this are 
> - CannotProceedException
> - NoPermissionException
> The good news is that I even can provide the exception constructor with some extra information

> that might help the searching user to adapt the query in order to succeed subsequently.
> Unfortunately, such exception explanation are ignored in SearchHandler.java and only

>   "failed on search operation"
> is returned to the client
> Please find a diff below how this might be solved.
> Secondly, it would be great to be able to localize also the main error texts. Since our
> searches are only executed after a "bind" we do have the possibility to know the locale
> preferences from our own user-data-base.
> What do you think.
> --- SearchHandler.java.orig	2006-06-16 09:56:02.000000000 +0200
> +++ SearchHandler.java	2006-06-16 09:57:28.000000000 +0200
> @@ -345,7 +345,13 @@
>  
>              LdapResult result = req.getResultResponse().getLdapResult();
>              result.setResultCode( code );
> -            result.setErrorMessage( msg );
> +            String extraInfo="";
> +            if (e.getMessage() != null) {
> +                if (e.getMessage().trim().length()>0) {
> +                    extraInfo=": " + e.getMessage();
> +                }
> +            }
> +            result.setErrorMessage( msg + extraInfo );
>  
>              if ( ( e.getResolvedName() != null )
>                  && ( ( code == ResultCodeEnum.NOSUCHOBJECT ) || ( code == ResultCodeEnum.ALIASPROBLEM
)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message