incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christophe Lombart <christophe.lomb...@gmail.com>
Subject Re: [jcr-mapping] exceptions
Date Mon, 03 Oct 2005 09:35:27 GMT
On 10/3/05, Costin Leau <costin.leau@gmail.com> wrote:
> Hello,
>
> another remark on the exceptions from jcr-mapping project. Why isn't
> there a base exception
Yes there is one : JcrMappingException but we have not yet defined the
exception hierarchy. I would like to minize the number of exception.

 and why java.lang.Exception is extended instead
> of the javax.jcr.RepositoryException?

It is a good suggestion

> As the jcr-mapping is based on a JCR implementation it should extend
> the JCR exception hierarchy. Right now the code executing with
> jcr-mapping has to do a:
>
> try
> {
>   .. some code
> } catch (RepositoryException re)
> {
>    // from work on the repository
> } catch (JcrMappingException jme)
> {
>   // from mapping code
> }
>

Well, the code is still under dev and maybe we have to review the
exception management but why the following code is not correct ?

 try
 {
       some code
 }
 catch (Exception e)
 {
       throw new JcrMappingException("exception message" , e);
 }

Mime
View raw message