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
2010-07-09 08:33:27
So the next question is how do u determine who knows better :)
tvr
2010-07-09 08:36:52
@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
2010-07-09 08:38:49