File Coverage

blib/lib/Luka/Error.pm
Criterion Covered Total %
statement 27 38 71.0
branch n/a
condition n/a
subroutine 9 14 64.2
pod 0 5 0.0
total 36 57 63.1


line stmt bran cond sub pod time code
1             # $Id: Error.pm,v 1.1.1.1 2006/02/20 00:35:57 toni Exp $
2             package Luka::Error;
3 2     2   11 use strict;
  2         3  
  2         77  
4 2     2   12 use warnings;
  2         3  
  2         65  
5 2     2   12 use vars qw($VERSION);
  2         3  
  2         82  
6 2     2   12 use Error;
  2         3  
  2         12  
7 2     2   97 use Data::Dumper;
  2         5  
  2         84  
8 2     2   11 use Cwd;
  2         4  
  2         134  
9 2     2   13 use File::Spec;
  2         3  
  2         48  
10 2     2   13 use base qw(Error::Simple);
  2         3  
  2         1780  
11 2     2   480 use Luka;
  2         5  
  2         445  
12             $VERSION = '1.00';
13             $Error::Debug = 1;
14              
15 0     0 0   sub set_id { $_[0]->{id} = $_[1] }
16 0     0 0   sub set_path { $_[0]->{path} = $_[1] }
17 0     0 0   sub id { $_[0]->{id} }
18 0     0 0   sub path { $_[0]->{path} }
19              
20             sub report {
21 0     0 0   my $self = shift;
22              
23 0           $self->set_path( cwd() );
24              
25 0           my ($vol,$dir,$file) = File::Spec->splitpath($0);
26              
27 0           $self->{id} = "generic"; # this is a class for generic errors
28              
29 0           my $obj = Luka->new({ filename => $file,
30             error => $self });
31 0           $obj->report_error();
32 0           return;
33             }
34              
35             1;
36