Fix catching NameAlreadyBoundException
Closes #29142 Signed-off-by: Robin Meese <39960884+robson90@users.noreply.github.com>
This commit is contained in:
parent
e93b7d4f3a
commit
8a5fb8337b
1 changed files with 2 additions and 1 deletions
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package org.keycloak.storage.ldap.idm.store.ldap;
|
package org.keycloak.storage.ldap.idm.store.ldap;
|
||||||
|
|
||||||
|
import javax.naming.NameAlreadyBoundException;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
import org.keycloak.common.util.Base64;
|
import org.keycloak.common.util.Base64;
|
||||||
import org.keycloak.models.KeycloakSession;
|
import org.keycloak.models.KeycloakSession;
|
||||||
|
@ -116,7 +117,7 @@ public class LDAPIdentityStore implements IdentityStore {
|
||||||
ModificationItem item = new ModificationItem(DirContext.ADD_ATTRIBUTE, attr);
|
ModificationItem item = new ModificationItem(DirContext.ADD_ATTRIBUTE, attr);
|
||||||
try {
|
try {
|
||||||
this.operationManager.modifyAttributesNaming(groupDn, new ModificationItem[]{item}, null);
|
this.operationManager.modifyAttributesNaming(groupDn, new ModificationItem[]{item}, null);
|
||||||
} catch (AttributeInUseException e) {
|
} catch (AttributeInUseException | NameAlreadyBoundException e) {
|
||||||
logger.debugf("Group %s already contains the member %s", groupDn, value);
|
logger.debugf("Group %s already contains the member %s", groupDn, value);
|
||||||
} catch (NamingException e) {
|
} catch (NamingException e) {
|
||||||
throw new ModelException("Could not modify attribute for DN [" + groupDn + "]", e);
|
throw new ModelException("Could not modify attribute for DN [" + groupDn + "]", e);
|
||||||
|
|
Loading…
Reference in a new issue