sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r1723673 - /sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
Date Fri, 08 Jan 2016 10:00:19 GMT
Author: kwin
Date: Fri Jan  8 10:00:18 2016
New Revision: 1723673

URL: http://svn.apache.org/viewvc?rev=1723673&view=rev
Log:
SLING-5389 - also log injection exceptions with level debug in case the injection is optional

Modified:
    sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java

Modified: sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java?rev=1723673&r1=1723672&r2=1723673&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
(original)
+++ sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
Fri Jan  8 10:00:18 2016
@@ -447,6 +447,10 @@ public class ModelAdapterFactory impleme
         // if default is not set, check if mandatory
         if (!wasInjectionSuccessful) {
             if (element.isOptional(annotationProcessor)) {
+                // log previous injection error, if there was any
+                if (lastInjectionException != null) {
+                    log.debug("Injection into optional element {} failed because of: " +
lastInjectionException.getMessage(), element.getAnnotatedElement(), lastInjectionException);
+                }
                 if (element.isPrimitive()) {
                     RuntimeException throwable = injectPrimitiveInitialValue(element, callback);
                     if (throwable != null) {



Mime
View raw message