You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2015/04/21 15:18:58 UTC
[jira] [Created] (SLING-4644) SlingException is not properly
propagated by ResourceProviderEntry.getInternalResource(...)
Konrad Windszus created SLING-4644:
--------------------------------------
Summary: SlingException is not properly propagated by ResourceProviderEntry.getInternalResource(...)
Key: SLING-4644
URL: https://issues.apache.org/jira/browse/SLING-4644
Project: Sling
Issue Type: Bug
Components: ResourceResolver
Affects Versions: Resource Resolver 1.2.4
Reporter: Konrad Windszus
Currently any exception thrown from the {{ResourceResolverEntry.getResourceFromProviders}} (https://github.com/apache/sling/blob/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntry.java#L389), is caught by {{ResourceProviderEntry.getInternalResource}} (https://github.com/apache/sling/blob/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntry.java#L383) and only logged on debug level. This leads to the case that if the underlying resource provider throws a {{SlingException}} during its {{getResource}} that exception is gonna be swallowed (and not rethrown properly). Only a log statement with level debug would give some explanation on why the getResource would fail. But according to the javadoc the {{ResourceResolver.getResource}} should rather throw a {{SlingException}} in that case.
I would suggest to rewrite that exception handling in https://github.com/apache/sling/blob/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntry.java#L383 to properly propagate all {{SlingException}}s.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)