Browse code

BM-15039 Fix: improve logs on user or group import error

Anthony Prades authored on 09/07/2019 16:49:01
Showing 2 changed files
... ...
@@ -115,9 +115,7 @@ public abstract class GroupManager extends EntityManager {
115 115
 
116 116
 			group.value = pluginGroup.group;
117 117
 		} catch (LdapInvalidAttributeValueException e) {
118
-			String errorMsg = String.format("Unable to convert entry:%s to a valid BlueMind group", entry.getDn());
119
-			logger.error(errorMsg);
120
-			throw new ServerFault(errorMsg);
118
+			throw new ServerFault(e);
121 119
 		}
122 120
 	}
123 121
 
... ...
@@ -115,7 +115,7 @@ public abstract class UserManager extends EntityManager {
115 115
 
116 116
 	public abstract List<? extends UuidMapper> getUserGroupsMemberGuid(LdapConnection ldapCon);
117 117
 
118
-	public void update(ItemValue<User> currentUser, MailFilter mailFilter) throws ServerFault {
118
+	public void update(ItemValue<User> currentUser, MailFilter mailFilter) {
119 119
 		update(new ImportLogger(), currentUser, mailFilter);
120 120
 	}
121 121
 
... ...
@@ -174,9 +174,7 @@ public abstract class UserManager extends EntityManager {
174 174
 			mailboxQuota = pluginUser.mailboxQuota;
175 175
 			setMailFilter(pluginUser.mailFilter);
176 176
 		} catch (LdapInvalidAttributeValueException e) {
177
-			String errorMsg = String.format("Unable to convert entry:%s to a valid BlueMind user", entry.getDn());
178
-			logger.error(errorMsg);
179
-			throw new ServerFault(errorMsg);
177
+			throw new ServerFault(e);
180 178
 		}
181 179
 	}
182 180