Skip to content

Commit 9d1ab3d

Browse files
committed
Always persist history
Even when some exception happened during loginService This closes #779
1 parent 7056c99 commit 9d1ab3d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/impl/AcInstallationServiceImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ public InstallationLog apply(String configurationRootPath, String[] restrictedTo
202202
return applyMultipleConfigurations(restrictedToPaths, skipIfConfigUnchanged);
203203
}
204204
}
205-
206205
PersistableInstallationLogger installLog = new PersistableInstallationLogger();
207206
Session session = null;
208207
try {
@@ -214,13 +213,11 @@ public InstallationLog apply(String configurationRootPath, String[] restrictedTo
214213
configFiles = configFilesRetriever.getConfigFileContentFromNode(configurationRootPath, session);
215214
} catch (Exception e) {
216215
installLog.addError("Could not retrieve configuration from path "+configurationRootPath+": "+e.getMessage(), e);
217-
persistHistory(installLog);
218216
return installLog;
219217
}
220218

221219
// install config files
222220
installConfigurationFiles(installLog, configFiles, restrictedToPaths, session, skipIfConfigUnchanged);
223-
224221
} catch (AuthorizableCreatorException e) {
225222
// exception was added to history in installConfigurationFiles() before it was saved
226223
LOG.warn("Exception during installation of authorizables (no rollback), e=" + e, e);
@@ -234,6 +231,7 @@ public InstallationLog apply(String configurationRootPath, String[] restrictedTo
234231
LOG.error("Exception in AceServiceImpl: {}", e);
235232
// exception was added to history in installConfigurationFiles() before it was saved
236233
} finally {
234+
persistHistory(installLog);
237235
if (session != null) {
238236
session.logout();
239237
}

0 commit comments

Comments
 (0)