From 9d1ab3d97803a580cfaafcfe6f47080c19643c16 Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Sun, 26 Jan 2025 15:17:07 +0100 Subject: [PATCH] Always persist history Even when some exception happened during loginService This closes #779 --- .../cq/tools/actool/impl/AcInstallationServiceImpl.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/impl/AcInstallationServiceImpl.java b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/impl/AcInstallationServiceImpl.java index a849fc1bf..dd14d5ba8 100644 --- a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/impl/AcInstallationServiceImpl.java +++ b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/impl/AcInstallationServiceImpl.java @@ -202,7 +202,6 @@ public InstallationLog apply(String configurationRootPath, String[] restrictedTo return applyMultipleConfigurations(restrictedToPaths, skipIfConfigUnchanged); } } - PersistableInstallationLogger installLog = new PersistableInstallationLogger(); Session session = null; try { @@ -214,13 +213,11 @@ public InstallationLog apply(String configurationRootPath, String[] restrictedTo configFiles = configFilesRetriever.getConfigFileContentFromNode(configurationRootPath, session); } catch (Exception e) { installLog.addError("Could not retrieve configuration from path "+configurationRootPath+": "+e.getMessage(), e); - persistHistory(installLog); return installLog; } // install config files installConfigurationFiles(installLog, configFiles, restrictedToPaths, session, skipIfConfigUnchanged); - } catch (AuthorizableCreatorException e) { // exception was added to history in installConfigurationFiles() before it was saved LOG.warn("Exception during installation of authorizables (no rollback), e=" + e, e); @@ -234,6 +231,7 @@ public InstallationLog apply(String configurationRootPath, String[] restrictedTo LOG.error("Exception in AceServiceImpl: {}", e); // exception was added to history in installConfigurationFiles() before it was saved } finally { + persistHistory(installLog); if (session != null) { session.logout(); }