File Coverage

blib/lib/Servlet/Util/Exception.pm
Criterion Covered Total %
statement 30 39 76.9
branch n/a
condition 0 3 0.0
subroutine 10 13 76.9
pod n/a
total 40 55 72.7


line stmt bran cond sub pod time code
1             # -*- Mode: Perl; indent-tabs-mode: nil; -*-
2              
3             package Servlet::Util::Exception;
4              
5 4     4   4441 use Exception::Class ();
  4         58439  
  4         104  
6              
7 4     4   42 use base qw(Exception::Class::Base);
  4         31  
  4         372  
8 4     4   24 use strict;
  4         6  
  4         112  
9 4     4   21 use warnings;
  4         89  
  4         646  
10              
11             # for some reason, if i try to declare subclasses via
12             # Exception::Class::import(), things break. i can't figure out why,
13             # and it's not really important.
14              
15             __PACKAGE__->do_trace(1);
16              
17             sub new {
18 0     0     my $type = shift;
19 0           my $msg = shift;
20              
21 0   0       my $class = ref($type) || $type;
22 0           my $self = $class->SUPER::new(error => $msg);
23              
24 0           return $self;
25             }
26              
27             sub getMessage {
28 0     0     my $self = shift;
29              
30 0           return $self->error();
31             }
32              
33             sub toString {
34 0     0     my $self = shift;
35              
36 0           return $self->to_string();
37             }
38              
39             1;
40              
41             package Servlet::Util::IOException;
42              
43 4     4   21 use base qw(Servlet::Util::Exception);
  4         8  
  4         391  
44              
45             __PACKAGE__->do_trace(1);
46              
47             1;
48             package Servlet::Util::IllegalArgumentException;
49              
50 4     4   33 use base qw(Servlet::Util::Exception);
  4         8  
  4         404  
51              
52             __PACKAGE__->do_trace(1);
53              
54             1;
55             package Servlet::Util::IllegalStateException;
56              
57 4     4   22 use base qw(Servlet::Util::Exception);
  4         15  
  4         425  
58              
59             __PACKAGE__->do_trace(1);
60              
61             1;
62             package Servlet::Util::IndexOutOfBoundsException;
63              
64 4     4   31 use base qw(Servlet::Util::Exception);
  4         12  
  4         531  
65              
66             __PACKAGE__->do_trace(1);
67              
68             1;
69             package Servlet::Util::UndefReferenceException;
70              
71 4     4   41 use base qw(Servlet::Util::Exception);
  4         7  
  4         333  
72              
73             __PACKAGE__->do_trace(1);
74              
75             1;
76             package Servlet::Util::UnsupportedEncodingException;
77              
78 4     4   21 use base qw(Servlet::Util::Exception);
  4         8  
  4         335  
79              
80             __PACKAGE__->do_trace(1);
81              
82             1;
83             __END__