Instead allow skipping invalid user names in the same way non-existent user names are skipped.
|
for (final String u: usersplt) { |
|
try { |
|
uns.add(new UserName(u.trim())); |
|
} catch (MissingParameterException | IllegalParameterException e) { |
|
//TODO CODE this exception could use some clean up |
|
throw new IllegalParameterException(ErrorType.ILLEGAL_USER_NAME, String.format( |
|
"Illegal user name [%s]: %s", u, e.getMessage())); |
|
} |
|
} |
|
return uns; |