Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Exception::Class - how to use?

by Perllace (Acolyte)
on Apr 21, 2011 at 13:48 UTC ( #900614=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Exception::Class - how to use?
in thread Exception::Class - how to use?

Yes Corion..was in fix to get this done and... i didn't notice that the thread was 5 years old.. cud finally figure out how to do this ...

use Exception::Class ( 'MyExceptions::Test' => { fields => [qw{message}], } ); use Moose::Util::TypeConstraints; class_type 'MyExceptions::ExecutionTest'; no Moose::Util::TypeConstraints; 1;
then to throw the exception
MyExceptions::ExceptionTest->throw( message => $data )
then the script has something like
if ( my $ex = $@ ) { my $e; if ( $e = Exception::Class->caught('MyExceptions::ExecutionTest')) { print $e->message; } }
Thanks for your help


Comment on Re^3: Exception::Class - how to use?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://900614]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (16)
As of 2015-07-30 12:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls