in reply to Exception::Class - how to use?
package MyExceptions; use strict; use warnings; use Exception::Class ( 'MyExceptions', 'MyExceptions::RegionNotFound' => { isa => 'MyExceptions' }, 'MyExceptions::CommandNotExecuted' => { isa => 'MyExceptions' } ); 1;
Then I have another module to report the exceptions handled
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'); #how do I do it?? }
The user would script something like this
Could you throw some light on this please..I have no idea is this kind of exception handling is the right way either..$Report->CheckResult($ABC->Command(100,100),"Someinfo")
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Exception::Class - how to use?
by Corion (Patriarch) on Apr 20, 2011 at 11:59 UTC | |
by Perllace (Acolyte) on Apr 21, 2011 at 13:48 UTC |