[jboss-dev] throws Throwable

Max Rydahl Andersen max.andersen at redhat.com
Wed May 6 13:28:20 EDT 2009



Tim Fox wrote:
> David M. Lloyd wrote:
>> On 05/05/2009 03:02 AM, Carlo de Wolf wrote:
>>> What's the use case for having a public method: doSomething(Object 
>>> someArgs...) throws Throwable ? 
>>
>> No valid use cases exist afaik.  Any method that throws Throwable 
>> should die, if it's within our power to kill it. 
> Declaring a method as "throws Throwable" forces the caller to handle 
> the exception even if the exception/error thrown is unchecked.
Then do throws RuntimeException

Error's are *nonrecoverable* since they are OutOfMemory or hard VM 
errors.No client can ever recover sanely.

/max



More information about the jboss-development mailing list