tags:

views:

33

answers:

1

In designing class with multiple/nested has-a relationships, who should catch exceptions? I guess this depends on design but is there any rule of thumb?

+1  A: 

The rule of thumb is the one who knows better what to do with that exception should catch the exception.

sharptooth
So the next question is how do u determine who knows better :)
tvr
@user386338: That's easy. Some class catches the exception and... what does it do? If it can only show an error message that's obviously the wrong class - the same could have been achieved by handling all exceptions on the top level.
sharptooth