[Tutor] Should error checking be duplicated for both functions if one function calls another one?
Laura Creighton
lac at openend.se
Mon Jun 1 17:58:03 CEST 2015
How many layers do you expect your program to have? (And if the
answer is 'a whole lot' then maybe your design needs to be reconsidered.)
Dealing with the exception at the lowest level that can deal with it
is usually a good idea. Also dealing with the exception at the top level,
so that when bad things happen (i.e. the low level that was supposed to
catch it had a bug and didn't) your program doesn't terminate, but
bravely tries to do the best it can -- this often a good idea. Copy and
pasting the same wretched error handling code into every layer of
your program is pretty much never a good idea.
Laura
More information about the Tutor
mailing list