I would like to agree with that, BUT have a separate subclass of
RuntimeException that is caught high up and can be used to generate a
Report back to the Pivot team.


-- Niclas

On Thu, Aug 6, 2009 at 4:42 PM, Noel Grandin<[email protected]> wrote:
> Hi
>
> I notice that in places Pivot has code like this:
>        try {
>          ... stuff....
>        } catch(IllegalAccessException exception) {
>        } catch(InstantiationException exception) {
>        }
>
> My preferred pattern for ignored exceptions is this:
>        try {
>          ... stuff....
>        } catch(IllegalAccessException exception) {
>           throw new RuntimeException(exception); // should never happen
>        } catch(InstantiationException exception) {
>           throw new RuntimeException(exception); // should never happen
>        }
>
> Just so that I get a stacktrace in those rare cases, where yes, somebody
> did something extra-ordinarily stupid and managed to trigger the exception.
>
> Comments?
>
> -- Noel.
>



-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

Reply via email to