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 ...
then to throw the exceptionuse Exception::Class ( 'MyExceptions::Test' => { fields => [qw{message}], } ); use Moose::Util::TypeConstraints; class_type 'MyExceptions::ExecutionTest'; no Moose::Util::TypeConstraints; 1;
then the script has something likeMyExceptions::ExceptionTest->throw( message => $data )
Thanks for your helpif ( my $ex = $@ ) { my $e; if ( $e = Exception::Class->caught('MyExceptions::ExecutionTest')) { print $e->message; } }
|
---|
In Section
Seekers of Perl Wisdom