Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Exception::Class - how to use?

by Arunbear (Parson)
on Aug 24, 2005 at 22:14 UTC ( #486383=note: print w/replies, xml ) Need Help??


in reply to Exception::Class - how to use?

Yes, that is how it works (there's no point in catching the exception inside set_number because set_number is using the exception to signal failure to calling code).

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) }; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://486383]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2016-12-04 21:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (69 votes). Check out past polls.