Error-Subclasses

 view release on metacpan or  search on metacpan

lib/Error/SystemException.pm  view on Meta::CPAN

Because it is a subclass of C<Error>, the usual try/catch mechanisms also
apply to it.

 try {
     mkdir( $dir ) 
         or throw Error::SystemException( "mkdir($dir)" );

     try {
         chmod( $mode, $dir )
             or throw Error::SystemException( "chmod($dir)" );
         chown( $uid, $gid, $dir )
             or throw Error::SystemException( "chown($dir)" );
     }
     catch Error with {
         my $e = shift;
         rmdir( $dir );
         $e->throw;
     };
 }
 catch Error with {
     my $e = shift;
     # handle $e here...



( run in 0.793 second using v1.01-cache-2.11-cpan-71847e10f99 )