in reply to Re^2: Exception::Class - how to use?
in thread Exception::Class - how to use?
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; } }
|
|---|