[ 
https://issues.apache.org/jira/browse/OAK-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13269905#comment-13269905
 ] 

Jukka Zitting commented on OAK-89:
----------------------------------

-1 to {{extends RuntimeException}}

In cases where we need to pass typed error information, i.e. an OakException or 
a RepositoryException instead of a generic (Runtime)Exception, we should IMHO 
do so in a type-safe manner using checked exceptions.

Unchecked exceptions should IMHO only be used for errors that the client has no 
control over and thus doesn't need typed information about.

If we need such an OakException base class, then it should show up in all the 
appropriate places in our interfaces (both internal and external) so it can be 
properly documented and tracked. Otherwise we'll just end up treating it as a 
generic "I can just throw this without worrying about the design consequences" 
-exception.

                
> Improve exception handling
> --------------------------
>
>                 Key: OAK-89
>                 URL: https://issues.apache.org/jira/browse/OAK-89
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core, jcr
>    Affects Versions: 0.2.1
>            Reporter: Michael Dürig
>
> As discusses on the @oak-dev list [1] we need to improve the way exceptions 
> are thrown and handled. 
> I suggest to create a OakException which extends from RuntimeException and 
> encapsulate a RepositoryException into it. These exceptions can then be 
> handled where appropriate. We can the later turn this into a more 
> sophisticated mechanism where the OakException is mapped to a corresponding 
> RepositoryException by an injected mapping (see Jukka's proposal in the 
> discussion).
> [1] http://markmail.org/message/t5czrpkvyamn7sym

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to