X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.util%2Fsrc%2Forg%2Fargeo%2Fosgi%2Fuseradmin%2FLdifGroup.java;h=80bff59472a7799ca5fdd1ada85ebd91215ac2cb;hb=cceead8a279e8630f63cc9e8213bdcdca39955a5;hp=b7167ea134684bacf63b25618446e8b198db27a5;hpb=eb4324be6ac9cdff15828a21ee7d3f6ca2f19fb9;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.util/src/org/argeo/osgi/useradmin/LdifGroup.java b/org.argeo.util/src/org/argeo/osgi/useradmin/LdifGroup.java index b7167ea13..80bff5947 100644 --- a/org.argeo.util/src/org/argeo/osgi/useradmin/LdifGroup.java +++ b/org.argeo.util/src/org/argeo/osgi/useradmin/LdifGroup.java @@ -5,6 +5,7 @@ import java.util.List; import javax.naming.InvalidNameException; import javax.naming.NamingEnumeration; +import javax.naming.NamingException; import javax.naming.directory.Attribute; import javax.naming.directory.Attributes; import javax.naming.ldap.LdapName; @@ -73,7 +74,7 @@ abstract class LdifGroup extends LdifUser implements DirectoryGroup { for (LdapName ldapName : getMemberNames()) { Role role = findRole(ldapName); if (role == null) { - throw new UserDirectoryException("Role " + ldapName + " cannot be added."); + throw new IllegalStateException("Role " + ldapName + " not found."); } directMembers.add(role); } @@ -107,8 +108,8 @@ abstract class LdifGroup extends LdifUser implements DirectoryGroup { roles.add(dn); } return roles; - } catch (Exception e) { - throw new UserDirectoryException("Cannot get members", e); + } catch (NamingException e) { + throw new IllegalStateException("Cannot get members", e); } }