authenticator do not return key so add a message field

git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1416991 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-12-04 15:26:55 +00:00
parent dd93a29b34
commit 75af5e0fec
2 changed files with 22 additions and 1 deletions

View File

@ -33,6 +33,11 @@ public class ErrorMessage
private String[] args;
/**
* @since 2.1 for message without any key
*/
private String message;
private static final String[] EMPTY = new String[0];
public ErrorMessage()
@ -71,4 +76,20 @@ public class ErrorMessage
{
this.args = args;
}
public String getMessage()
{
return message;
}
public void setMessage( String message )
{
this.message = message;
}
public ErrorMessage message( String message )
{
this.message = message;
return this;
}
}

View File

@ -155,7 +155,7 @@ public class DefaultLoginService
List<ErrorMessage> errorMessages = new ArrayList<ErrorMessage>();
for ( Map.Entry<String, String> entry : securitySession.getAuthenticationResult().getExceptionsMap().entrySet() )
{
errorMessages.add( new ErrorMessage( entry.getValue() ) );
errorMessages.add( new ErrorMessage().message( entry.getValue() ) );
}
throw new RedbackServiceException( errorMessages );