[Biojava-l] BioRuntimeException

Thomas Down td2@sanger.ac.uk
Mon, 6 Aug 2001 14:01:05 +0100


On Sun, Aug 05, 2001 at 03:41:54PM +1200, Mark Schreiber wrote:
> I'm personally a big fan of runtime exceptions but I think the argument
> was about making ChangeVetoExceptions a sub class of RuntimeException. I'm
> not sure if this is the same as what you are doing. What do you want to do
> with them?

The BioRuntimeException proposal comes in because there are lots
of methods on some of the core BioJava interfaces which aren't
declared to throw any exceptions.  This becomes a problem now
that we have so many `lazy-fetch' implementations of BioJava
objects (DAS, Ragbag, biojava-ensembl, and more coming all the
time...).

At the moment, these objects are throwing BioErrors, which
are not appropriate under the circumstances.

Ideally, I'd like to see more exception support added to the
interfaces.  On the other hand, this would be a big, incompatible
change.  Most people want more API stability, not less, so I'd
like to get at least a BioJava 1.2.x branch out using the current
APIs, saving big changes for 2.x.

BioRuntimeException is a `quick fix' solution to this -- unchecked
exceptions, but documented on specific implementations so you can
catch them if necessary.



The ChangeVetoExceptions are a rather different issue.  They
were designed in from the start (well, from version 1.1), and
the interfaces already throw them when necessary.  I'm afraid
I see changing these to be unchecked exceptions as a step
backwards, not fowards.

If you genuinely want all your exceptions to be unchecked
(which I agree can sometimes be useful) there's always the
trick of adding `throws Exception' on all your methods.

    Thomas.