Seems a bit unnecessary to me.

It might appear that the advantage of sub classing RuntimeException would be
that we are able to quickly identify exceptions generated in the Pivot
framework, but this is countered by the fact we have no way to stop
application developers using Pivot also throwing that exception.  I suppose
we could document it like so:

"This exception is intended to be thrown by the Pivot framework.  Please
> don't use this exception."
>

but my view on that is, why have that class in the API if people aren't
supposed to use it?

Assuming the 'End User' is even able to get their hands on the exception
stack trace, the error reporting flow is likely to be something like:

End User  -> (1st or 2nd line support maybe) -> App Developer -> Pivot Team

The App Developer is likely to be able to determine if the problem should be
reported to the Pivot team by simply looking at the stack trace.

Cheers,
Chris



2009/8/6 Niclas Hedhman <[email protected]>

> 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