What guidlines do you use when deciding whether to let a method dodge an exception (ie: let the exception propogate up) or handle it once the exception is recieved?
Here is an example of what I am trying to ask
If I have three methods method1,2,3 and 3. Method1 calls Method2 which Calls Method3. and the exception is only thrown in method 3 when should I let the exception propogate upward as follows (excuse my pseudo java ;) )
method1 {
try {
call method2;
} catch (exception e) {
doErrorProcessing;
}
}
method2 throws exception {
call method3;
}
method3 throws exception {
call readFile;
}
And when should I handle the exception once it is raised as follows
method1 {
call method2;
}
method2 {
call method3;
}
method3 {
try {
call readFille
} catch (exception e) {
doErrorProcessing;
}
}