You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2019/02/25 12:38:43 UTC
[sling-org-apache-sling-installer-provider-installhook] 24/24:
SLING-8291 expose error message as well for existing bundle which is not
yet in INSTALLED state
This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch feature/SLING-8291_expose-error
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-provider-installhook.git
commit b0b28413412ce54b286ecca560e4619ad1bf76c9
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Mon Feb 25 13:38:09 2019 +0100
SLING-8291 expose error message as well for existing bundle which is not
yet in INSTALLED state
---
pom.xml | 2 +-
.../sling/installer/provider/installhook/OsgiInstallerHook.java | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 4b62962..ac7d8fe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -90,7 +90,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.installer.core</artifactId>
- <version>3.6.8</version>
+ <version>3.8.0</version>
<scope>provided</scope>
</dependency>
<dependency>
diff --git a/src/main/java/org/apache/sling/installer/provider/installhook/OsgiInstallerHook.java b/src/main/java/org/apache/sling/installer/provider/installhook/OsgiInstallerHook.java
index 6ca0eec..1cc7864 100644
--- a/src/main/java/org/apache/sling/installer/provider/installhook/OsgiInstallerHook.java
+++ b/src/main/java/org/apache/sling/installer/provider/installhook/OsgiInstallerHook.java
@@ -20,6 +20,7 @@ package org.apache.sling.installer.provider.installhook;
import java.io.IOException;
import java.io.InputStream;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Dictionary;
@@ -267,7 +268,12 @@ public class OsgiInstallerHook implements InstallHook {
+ currentlyActiveBundleVersion + " that matches " + bundle.version + " as provided in package");
}
} else {
- logger.log("Bundle " + bundle.symbolicName + " is not in state INSTALLED but in " + resource.getState());
+ String msg = MessageFormat.format("Bundle {0} is not in state INSTALLED but in {1}", bundle.symbolicName, resource.getState());
+ if (StringUtils.isNotEmpty(resource.getError())) {
+ // related error if there is some
+ msg += "Error: " + resource.getError();
+ }
+ logger.log(msg);
needsInstallation = true;
}