File Coverage

lib/ExtUtils/XSpp/Exception/stdmessage.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::stdmessage;
2 21     21   113 use strict;
  21         40  
  21         2962  
3 21     21   115 use warnings;
  21         41  
  21         564  
4 21     21   103 use base 'ExtUtils::XSpp::Exception';
  21         39  
  21         1499  
5              
6             sub init {
7 90     90 0 191 my $this = shift;
8 90         437 $this->SUPER::init(@_);
9             }
10              
11             sub handler_code {
12 87     87 1 158 my $this = shift;
13 87         136 my $no_spaces_indent = shift;
14 87 50       304 $no_spaces_indent = 4 if not defined $no_spaces_indent;
15              
16 87         406 my $ctype = $this->cpp_type;
17 87         268 my $msg = "Caught C++ exception of type or derived from '$ctype': \%s";
18 87         227 my $code = <
19             catch ($ctype& e) {
20             croak("$msg", e.what());
21             }
22             HERE
23 87         352 return $this->indent_code($code, $no_spaces_indent);
24             }
25              
26             1;