To make it a bit nicer, you could use Exception::Class::TryCatch in tandem with Exception::Class -
use Exception::Class::TryCatch; ... # try eval { $obj->some_method('foo') }; # catch if ( catch my $err ) { $err->isa('Bio::Phylo::Exceptions::BadNumber') and do { handle_this( +$err) }; $err->isa('Bio::Phylo::Exceptions::ObjectMismatch') and do { handle_ +that($err) }; }
In reply to Re: Exception::Class - how to use?
by Arunbear
in thread Exception::Class - how to use?
by rvosa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |