File Coverage

lib/ExtUtils/XSpp/Exception/simple.pm
Criterion Covered Total %
statement 18 18 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 1 2 50.0
total 25 27 92.5


line stmt bran cond sub pod time code
1             package ExtUtils::XSpp::Exception::simple;
2 21     21   146 use strict;
  21         41  
  21         703  
3 21     21   130 use warnings;
  21         65  
  21         630  
4              
5 21     21   120 use base 'ExtUtils::XSpp::Exception';
  21         53  
  21         633  
6              
7             sub init {
8 2     2 0 4 my $this = shift;
9 2         10 $this->SUPER::init(@_);
10             }
11              
12             sub handler_code {
13 4     4 1 5 my $this = shift;
14 4         5 my $no_spaces_indent = shift;
15 4 50       8 $no_spaces_indent = 4 if not defined $no_spaces_indent;
16              
17 4         12 my $ctype = $this->cpp_type;
18 4         9 my $msg = "Caught C++ exception of type '$ctype'";
19 4         14 my $code = <
20             catch ($ctype& e) {
21             croak("$msg");
22             }
23             HERE
24 4         14 return $this->indent_code($code, $no_spaces_indent);
25             }
26              
27             1;