Disarming local exception handlers
Posted: Mon Sep 07, 2009 1:22 pm
Hi all.
Recently we had an issue where a local exception handler armed in method A (exHandlerA) was being disarmed by another method. So, method A calls B calls C calls D. D arms its own local exception handler (exHandlerD) inside an if clause, then has "on Exception do null;" outside the if clause. Which actually disarms exHandlerA (when the if clause is not executed) - as that is the next local handler on the exception handler stack.
First thing we knew a problem had occurred was we started getting stack dumps as exHandlerA wasn't armed (because of the funky code in method D).
Which makes me think it would be good if JADE had an option like this:
on Exception do null errorIfNotArmedInThisMethod;
alternatively, an ini file option to do the same. Does anyone think disarming a local exception handler in a method other than the one that armed it is useful / acceptable coding style ?
What do you think ?
Cheers, Simon B. (long time lurker).
Recently we had an issue where a local exception handler armed in method A (exHandlerA) was being disarmed by another method. So, method A calls B calls C calls D. D arms its own local exception handler (exHandlerD) inside an if clause, then has "on Exception do null;" outside the if clause. Which actually disarms exHandlerA (when the if clause is not executed) - as that is the next local handler on the exception handler stack.
First thing we knew a problem had occurred was we started getting stack dumps as exHandlerA wasn't armed (because of the funky code in method D).
Which makes me think it would be good if JADE had an option like this:
on Exception do null errorIfNotArmedInThisMethod;
alternatively, an ini file option to do the same. Does anyone think disarming a local exception handler in a method other than the one that armed it is useful / acceptable coding style ?
What do you think ?
Cheers, Simon B. (long time lurker).