Talk:Exceptions/Catch an exception thrown in a nested call: Difference between revisions

Line 16:
:Yes. You could change it to <code>throws Exception</code>, but then you would have to surround all calls to the function with a <code>try</code> block which would <code>catch(Exception e)</code>, which would then catch the U1 Exception and fail to meet the task requirements. I'm not sure if Java could do this task (or if it would even be good practice in any language). --[[User:Mwn3d|Mwn3d]] 05:47, 1 May 2009 (UTC)
:Also <code>throws Exception</code> and <code>catch(Exception e)</code> will both usually make me cringe a bit. Try to avoid them :). --[[User:Mwn3d|Mwn3d]] 06:20, 1 May 2009 (UTC)
 
==R code doesn't catch anything?==
Function foo should catch the first exception raised, but fail to catch the second exception. I don't know R, but I can't see where function foo catches one exception but not the other? --[[User:Paddy3118|Paddy3118]] 17:09, 23 November 2009 (UTC)
Anonymous user