File Coverage

blib/lib/Exception/Reporter/Summarizer/Fallback.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 2 0.0
total 24 26 92.3


line stmt bran cond sub pod time code
1 1     1   433 use strict;
  1         3  
  1         29  
2 1     1   6 use warnings;
  1         3  
  1         77  
3             package Exception::Reporter::Summarizer::Fallback 0.015;
4             # ABSTRACT: a summarizer for stuff you couldn't deal with otherwise
5              
6 1     1   8 use parent 'Exception::Reporter::Summarizer';
  1         2  
  1         5  
7              
8             #pod =head1 OVERVIEW
9             #pod
10             #pod This summarizer will accept any input and summarize it by dumping it with the
11             #pod Exception::Reporter's dumper.
12             #pod
13             #pod I recommended that this summarizer is always in your list of summarizers,
14             #pod and always last.
15             #pod
16             #pod =cut
17              
18 1     1   59 use Try::Tiny;
  1         2  
  1         194  
19              
20 4     4 0 10 sub can_summarize { 1 }
21              
22             sub summarize {
23 4     4 0 11 my ($self, $entry, $internal_arg) = @_;
24 4         9 my ($name, $value, $arg) = @$entry;
25              
26 4         17 my $fn_base = $self->sanitize_filename($name);
27              
28 4         20 my $dump = $self->dump($value, { basename => $fn_base });
29              
30             return {
31 4         46 filename => "$fn_base.txt",
32             ident => "dump of $name",
33             %$dump,
34             };
35             }
36              
37             1;
38              
39             __END__