File Coverage

blib/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   116 use strict;
  21         34  
  21         707  
3 21     21   62 use warnings;
  21         40  
  21         820  
4              
5 21     21   85 use base 'ExtUtils::XSpp::Exception';
  21         28  
  21         505  
6              
7             sub init {
8 2     2 0 3 my $this = shift;
9 2         12 $this->SUPER::init(@_);
10             }
11              
12             sub handler_code {
13 4     4 1 6 my $this = shift;
14 4         4 my $no_spaces_indent = shift;
15 4 50       12 $no_spaces_indent = 4 if not defined $no_spaces_indent;
16              
17 4         10 my $ctype = $this->cpp_type;
18 4         18 my $msg = "Caught C++ exception of type '$ctype'";
19 4         5 my $code = <
20             catch ($ctype& e) {
21             croak("$msg");
22             }
23             HERE
24 4         9 return $this->indent_code($code, $no_spaces_indent);
25             }
26              
27             1;