You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Thomas Mueller (JIRA)" <ji...@apache.org> on 2009/02/17 17:30:59 UTC

[jira] Commented: (JCR-1847) Path methods should throw a specific exception instead of RepositoryEx

    [ https://issues.apache.org/jira/browse/JCR-1847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674259#action_12674259 ] 

Thomas Mueller commented on JCR-1847:
-------------------------------------

I think just RepositoryException with an error codes would be better, as in JDBC (example: http://www.h2database.com/javadoc/org/h2/constant/ErrorCode.html ). Unfortunately RepositoryException doesn't have an error code. Specific exception just bloats everything (methods tend to end with "throws a, b, c, d,...", and there are many catch/throw cases). The JCR 1.0 API already has 18 exception types, which seems like far too many in my view.

Even more radical: only use unchecked exceptions (RepositoryException extends RuntimeException). So you don't have to catch / re-throw. Most modern languages (for example Scala) don't have checked exceptions any more.

> Path methods should throw a specific exception instead of RepositoryEx
> ----------------------------------------------------------------------
>
>                 Key: JCR-1847
>                 URL: https://issues.apache.org/jira/browse/JCR-1847
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-spi
>            Reporter: Alexander Klimetschek
>            Assignee: angela
>            Priority: Minor
>
> The o.a.j.spi.Path interface declares most methods to throw a RepositoryEx, whereas a o.a.j.spi.commons.conversion.NameEx (or another specific exception) would make more sense, since the RepositoryEx is too generic for what seems to be a "malformed names/path" nature for all things that happen in a Path implementation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.