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 |