Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by Corion (Pope)
on Apr 20, 2011 at 11:59 UTC ( #900320=note: print w/replies, xml ) Need Help??


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

See Using Perl Exception Class.

It makes little sense to ask the same question in two locations, especially in a thread that is 5 years old.

Replies are listed 'Best First'.
Re^3: Exception::Class - how to use?
by Perllace (Acolyte) on Apr 21, 2011 at 13:48 UTC
    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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://900320]
help
Chatterbox?
[Corion]: Hi choroba! Yeah, I brought the rain with me from Hamburg
[Corion]: marto: As am I ;) And we got two interested locations for next year, Munich and Cologne maybe, which is great as well. Not Berlin though ;)
[marto]: damn
[choroba]: Munich is kind of close from here
[Corion]: marto: Maybe in three years it'll be Berlin again ;)

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-06-29 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (655 votes). Check out past polls.