On 17.1.13 5:33, Jukka Zitting wrote:
Hi,

On Wed, Jan 16, 2013 at 11:04 PM, Jukka Zitting <[email protected]> wrote:
If yes, please revert, as these methods were intentionally added to
satisfy the need for different exceptions in different cases.

Hmm, on second thought that's a bit harsh and not too constructive,
sorry. Let me rephrase:

Hehe this is contagious isn't it ;-)


If yes, please make sure that all the name- and path-related
exceptions that get thrown are still appropriate in their contexts.

Right, I might have been too eager in some cases. Will reopen the issue and review.


Even though PathNotFoundException ISA RepositoryException, it has
fairly specific semantics and is thus not appropriate for all cases

Hat tip to Liskov ;-)

Michael

where names and paths are used. For example, is the following code
correct:

     try {
         if (!session.getNode("/a:b").hasNode(*c:d")) {
             System.out.println("/a:b/c:d does not exist");
         }
     } catch (PathNotFoundException e) {
         System.out.println("/a:b does not exist");
     }

Currently it would end up printing "/a:b does not exist" even if the
node /a:b did exist but the namespace prefix c didn't!

BR,

Jukka Zitting


Reply via email to