Hi,

Recently, while working on a separate issue, I landed on a seemingly
different behavior while finding resources via jcr resource resolver.

It seems that while finding resources JcrNodeResourceIterator [1] eats
exceptions while iterating over underlying result set. It logs and
ERROR though. Otoh, if some error occurs while creating the iterator
(say while doing getNodes [2]) then the exception gets thrown back to
caller (without any log message). While throw-or-log-error strategy, I
think, seems right, but the different in behavior for caller of
findResource seems incorrect to me. I think it should be consistent
one way or another.

That said, imo, I think the iterator is wrong here to assume that it's
ok to just log and error and continue with iteration without notifying
the caller - but I don't think I'm able enough to make such a call.

I'd love to hear inputs from this list (didn't open the issue because
I didn't really know if my feeling is really considered an issue or
not).

[1]: 
https://github.com/apache/sling-org-apache-sling-jcr-resource/blob/org.apache.sling.jcr.resource-3.0.16/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResourceIterator.java#L127
[2]: 
https://github.com/apache/sling-org-apache-sling-jcr-resource/blob/org.apache.sling.jcr.resource-3.0.16/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/BasicQueryLanguageProvider.java#L83

Thanks,
Vikas

Reply via email to