Originally posted by Maulin Vasavada:
hi leo
the problem is your catch() stmt,
catch(MyException me){
throw me;
}
that says that when the MyException will be catched, it will be thrown again...now when would it go from catch?? to the calling method (or outer block) right? and the calling method is someMethod() so u have to catch it there or throw it from that method.
here u r not "handling" the exception in a way that gets rid of it. the exception "me" is "re-thrown" from the catch. so basically its equal to write "throws MyException" in the doStuff() method instead of trying to catch and then throw the exception again...
do u get me?
regards
maulin
Hi maulin,
I follow you.
I put a finally clause after the catch stmt to see if finally *always* runs, it doesn't. I guess this is one of "those times" when finally doesn't run.
Thanks for your help