File Coverage

blib/lib/Servlet/ServletException.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             # -*- Mode: Perl; indent-tabs-mode: nil; -*-
2              
3             package Servlet::ServletException;
4              
5 2     2   6613 use base qw(Servlet::Util::Exception);
  2         5  
  2         1030  
6             use strict;
7             use warnings;
8              
9             __PACKAGE__->do_trace(1);
10              
11             sub new {
12             my $type = shift;
13             my $msg = shift;
14             my $root = shift;
15              
16             my $class = ref($type) || $type;
17             my $error = $root && !$msg ?
18             $root->getMessage() :
19             $msg;
20             my $self = $class->SUPER::new($error);
21              
22             $self->{root} = $root;
23              
24             return $self;
25             }
26              
27             sub getRootCause {
28             my $self = shift;
29              
30             return $self->{root};
31             }
32              
33             1;
34             __END__