Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Currently Sling Models logs the example model [1] as warning [2] if the sub model image does not exist. This really should be a debug log as it is totally fine if in optional field cannot be set?
[1]
com......mediagallery.MediaGalleryElement ... @Inject @Optional @Named(value = ".") private Image image;
[2] org.apache.sling.models.impl.ModelAdapterFactory.injectElement(InjectableElement, Object, Model, DisposalCallbackRegistry, InjectCallback)
// log previous injection error, if there was any if (lastInjectionException != null) { log.warn("Although falling back to default value worked, injection into {} failed because of: " + lastInjectionException.getMessage(), element.getAnnotatedElement(), lastInjectionException); }
Attachments
Issue Links
- breaks
-
SLING-5389 Sling Models: Do not swallow PostConstruct exceptions
- Closed
- relates to
-
SLING-9478 Expose the full stack trace for PostConstruct exceptions
- Resolved