Skip to content

Commit

Permalink
29142 fix catching NameAlreadyBoundException
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Meese <39960884+robson90@users.noreply.github.com>
  • Loading branch information
robson90 committed May 2, 2024
1 parent 3e16af8 commit 798dd48
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.keycloak.storage.ldap.idm.store.ldap;

import javax.naming.NameAlreadyBoundException;
import org.jboss.logging.Logger;
import org.keycloak.common.util.Base64;
import org.keycloak.models.KeycloakSession;
Expand Down Expand Up @@ -116,7 +117,7 @@ public void addMemberToGroup(LdapName groupDn, String memberAttrName, String val
ModificationItem item = new ModificationItem(DirContext.ADD_ATTRIBUTE, attr);
try {
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);
} catch (NamingException e) {
throw new ModelException("Could not modify attribute for DN [" + groupDn + "]", e);
Expand Down

0 comments on commit 798dd48

Please sign in to comment.