|
NAMEBio::Phylo::Util::Exceptions - Errors ($@) that are objects SYNOPSIS use Bio::Phylo::Forest::Node;
my $node = Bio::Phylo::Forest::Node->new;
# now let's try something illegal
eval {
$node->set_branch_length( 'non-numerical value' );
};
# have an error
if ( my $e = Bio::Phylo::Util::Exceptions::BadNumber->caught ) {
# print out where the error came from
print $@->trace->as_string;
# caught() returns $@, so $e and $@ are the
# same object in this example.
# Therefore, the same thing would be:
print $e->trace->as_string;
}
DESCRIPTIONSometimes, Bio::Phylo dies. If this happens because you did something that brought Bio::Phylo into an undefined and dangerous state (such as might happen if you provide a non-numerical value for a setter that needs numbers), Bio::Phylo will throw an "exception", a special form of the $@ variable that is a blessed object with useful methods to help you diagnose the problem. This package defines the exceptions that can be thrown by Bio::Phylo. There are no serviceable parts inside. Refer to the Exception::Class perldoc for more examples on how to catch exceptions and show traces. EXCEPTION CLASSES
METHODS
SEE ALSOThere is a mailing list at <https://groups.google.com/forum/#!forum/bio-phylo> for any user or developer questions and discussions.
CITATIONIf you use Bio::Phylo in published research, please cite it: Rutger A Vos, Jason Caravas, Klaas Hartmann, Mark A Jensen and Chase Miller, 2011. Bio::Phylo - phyloinformatic analysis using Perl. BMC Bioinformatics 12:63. <http://dx.doi.org/10.1186/1471-2105-12-63>
|