[Bioperl-l] Bioperl exceptions

Jason Stajich jason at cgt.duhs.duke.edu
Thu Jul 22 12:13:20 EDT 2004


On Thu, 22 Jul 2004, Peter van Heusden wrote:

> Hi Bioperl developers
>
> I'm a bit confused by the current state of play of the Bioperl exception
> class (Bio::Root::Exception). This inherits from Error, but Error.pm is
> not a requirement of Bioperl. It seems to me then that there are two
> exception mechanisms in Bioperl:
>
> 1) Exceptions based on exception objects, derived from Error.pm and
> implmented by Bio:Root::Exception and its subclasses.
> 2) Simple "stack dump" exceptions, which are implemented in Bio::Root's
> throw() method and used if Error.pm is not available.
>
> Is this right? If so, is the necessary result is that Error-based
> exceptions can't be used as part of any core Bioperl class? (Since that
> would force a dependence on Error.pm) I see that in the biodesign.pod
> documentation, the only semantics mentioned are the basic string based
> ones. Does this mean that using exception objects is deprecated (I see
> the Exception.pm class was last updated in Bioperl 1.3.01 days)?

The newer exception handling and throwing has been the brainchild of Steve
Chervitz.  I don't know what the long term plan is for this.  The standard
way is just to use Root::RootI throw/warn.  Aaron and I've experimented
with the newer Exception stuff use in Bio:Tools::Phylo::PAML.
There is a void here in that no one has really stepped up to say "this is
the way we want to do it".  Steve's code

I guess your observation about Error.pm based exceptions are correct - to
be honest I really don't know what should be the right thing here.  Not
much code in bioperl has try/catch blocks so I don't know that the use of
either are particularly useful.

-jason

>
> Peter
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu


More information about the Bioperl-l mailing list