jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mdue...@apache.org>
Subject Re: Exception handling in oak-core
Date Thu, 03 May 2012 13:19:18 GMT

On 3.5.12 13:43, Julian Reschke wrote:
> On 2012-05-03 14:26, Thomas Mueller wrote:
>> Hi,
>>> I wouldn't want to catch RuntimeException. I'd prefer if oak-core would
>>> only throw OakException (extends RuntimeException), as suggested by
>>> Michael Dürig.
>> +1
>>> I also think it would be good if these Oak exceptions could carry
>>> sufficient information to generate a JCR exception.
>> +1
>>> The mappings that have been suggested by Michael and above would help,
>>> but we'd lose correctness in the call stack, right?
>> Do you mean instead of one simple stack trace you would get two (the
>> original one as "Caused by:")? I think that's OK. If it's really a
>> problem
>> we could still use Exception.setStackTrace(..), but I don't think that's
>> necessary.
> If the OakException wraps a RepositoryException, we extract that one and
> rethrow it, it will come with an incorrect stack trace, no? So it seems
> we need to re-wrap.

That depends on what you consider correct ;-) With the approach I 
proposed earlier, clients would only observer the original stack trace 
(that is the one from the wrapped exception) which I consider good since 
this is the path to the origin of the problem.


> It seems we're converging on
> - OakException extends RuntimeException
> - OakExpception can carry RepositoryException
> Should we start with that, and see how this works? (Open a issue for it?)
> Best regards, Julian

View raw message