jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mueller <muel...@adobe.com>
Subject Re: Exceptions used in oak-core
Date Thu, 22 Mar 2012 12:49:29 GMT

>Here's my take at this: I'd use exceptions as sparingly as possible and
>only for cases where something unexpected (an exception!) happens. That
>is, I wouldn't use exceptions e.g. for items not being found. This is
>clearly something that happens all the time and is by no means unexpected.
>For the cases where exceptions are involved I would define our own very
>small set of exceptions and make them all *unchecked*. Checked
>exceptions compose very badly wrt. lazyness. For example an iterator
>which lazily fetches its items on next() has no clean way of handling
>exceptions in the next() method.
>Only at the very last instance (i.e. in the jcr component) I would
>actually create and throw the various RepositoryExceptions.

I completely agree with this view.


View raw message