Changes to web flow action proposal

Marvin S. Addison marvin.addison at gmail.com
Fri Apr 19 10:23:57 EDT 2013


>> try {
>>    doExecute(...);
>> } finally {
>>    try {
>>      doPostExecute(...);
>>    } catch (Exception e);
>>      log.error("doPostExecute failed", e);
>>    }
>> }
>
> I started there, but I'm not comfortable swallowing a runtime error
> altogether unless something else is being thrown.

If I understand your concern correctly, the block above satisfies your 
concern. An exception raised in doExecute is not caught by the catch in 
the finally block. I took a moment to reassure myself with a simple test 
[1] that produces the following output:

marvin at eiger:~/Code/java-test-classes$ java FinallyThrowsTest
Caught an exception in finally: Thrown from try/catch inside finally.
Exception in thread "main" java.lang.RuntimeException: Thrown from outer try
	at FinallyThrowsTest.main(FinallyThrowsTest.java:9)

M

[1] https://gist.github.com/serac/5420655


More information about the dev mailing list