On 03 Jul 2014, at 10:50, Alexander Klimetschek <aklim...@adobe.com> wrote:

> 
> I guess it would make sense to have adapterfactories et. al. to work like 
> this:
> a) if it is not of the desired type, i.e. cannot semantically be adapted, 
> return null
> b) if it fails due to some actual exception, throw a runtimexception

I would be fine with that approach. So the only change is a clarification in 
the Javadocs that adaptTo in fact may throw a RuntimeException (if the 
AdapterFactory has thrown an exception) and also that AdapterFactory may throw 
a RuntimeException.
As Felix Meschberger already pointed out, neither the SlingAdaptable nor the 
AdapterManager currently catch any exceptions so that would work already with 
existing code and Sling Models could start right away throwing 
RuntimeExceptions for validation purposes.

> 
> But not sure if that will work.
> 
> Cheers,
> Alex

Reply via email to