SLING-8291 expose error message as well for existing bundle which is not
yet in INSTALLED state
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..92d0a7b 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 @@
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 @@
+ 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 += " due to error '" + resource.getError() + "'";
+ }
+ logger.log(msg);
needsInstallation = true;
}