[ 
https://issues.apache.org/jira/browse/RAMPART-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471563
 ] 

Ruchith Udayanga Fernando commented on RAMPART-22:
--------------------------------------------------

How about changing the new WSSecurityException thrown to include the cause as 
well:

            try {
                cb.handle(callbacks);
            } catch (IOException e) {
                throw new WSSecurityException(WSSecurityException.FAILURE,
                        "noPassword",
                        new Object[]{user}, e);
            } catch (UnsupportedCallbackException e) {
                throw new WSSecurityException(WSSecurityException.FAILURE,
                        "noPassword",
                        new Object[]{user}, e);
            }

Thanks,
Ruchith

> Exception handling in UsernameTokenProcessor.handleUsernameToken
> ----------------------------------------------------------------
>
>                 Key: RAMPART-22
>                 URL: https://issues.apache.org/jira/browse/RAMPART-22
>             Project: Rampart
>          Issue Type: Bug
>            Reporter: Peter Hornig
>
> When UsernameTokenProcessor.handleUsernameToken sees an WSSecurityEception 
> (thrown by a WsPasswordCallback handler)
> it just overwrites this Exception 
> ---------------
>             try {
>                 cb.handle(callbacks);
>             } catch (IOException e) {
>                 throw new WSSecurityException(WSSecurityException.FAILURE,
>                         "noPassword",
>                         new Object[]{user});
> -------------
> - So when i throw an Exception which states: "password expired" , or  "wrong 
> password" , it it always converted into a new exception with the wrong reason.
> - The origin of the new Exception is not used as the cause of the new 
> exception, so there is no way to drill down to the cause of the Exception
>  

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

Reply via email to