You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2021/12/03 15:44:40 UTC
[GitHub] [sling-org-apache-sling-models-impl] stefanseifert commented on a change in pull request #28: SLING-8079 throw PostConstructException for createModel in case
stefanseifert commented on a change in pull request #28:
URL: https://github.com/apache/sling-org-apache-sling-models-impl/pull/28#discussion_r762043114
##########
File path: src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
##########
@@ -265,7 +265,11 @@ private void clearDisposalCallbackRegistryQueue() {
public <AdapterType> AdapterType getAdapter(Object adaptable, Class<AdapterType> type) {
Result<AdapterType> result = internalCreateModel(adaptable, type);
if (!result.wasSuccessful()) {
- log.warn("Could not adapt to model", result.getThrowable());
+ if (result == Result.POST_CONSTRUCT_PREVENTED_MODEL_CONSTRUCTION) {
+ log.warn("Could not adapt to model as PostConstruct method returned false"); // do no construct runtime exception in this case
Review comment:
should this be converted to debug message? if the postconstruct returned false, this is by intention and not something to be warned?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org