package MyExceptions;
use strict;
use warnings;
use Exception::Class (
'MyExceptions',
'MyExceptions::RegionNotFound' =>
{ isa => 'MyExceptions' },
'MyExceptions::CommandNotExecuted' =>
{ isa => 'MyExceptions' }
);
The other module is
package ReportGenerator;
use strict;
use warnings;
sub CheckResult {
my ( $result, $info ) = @_;
#Here is want to check of $result and throw an exception of the kin
+d MyExceptions::RegionNotFound->throw(error => 'bad number');
#I'm not sure how to do this..
}
1;
The user would inturn script something like this
$Report->CheckResult($ABC->Command(100,100),"Tapping Home");
Thanks for your help..
|