# try eval { $obj->set_number(sdf7897) }; # catch if (UNIVERSAL::isa($@,'Bio::Phylo::Exceptions::BadNumber')){ # do something }