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   386 use strict;
  1         1  
  1         25  
2 1     1   3 use warnings;
  1         1  
  1         35  
3             package Exception::Reporter::Summarizer::Fallback;
4             # ABSTRACT: a summarizer for stuff you couldn't deal with otherwise
5             $Exception::Reporter::Summarizer::Fallback::VERSION = '0.013';
6 1     1   3 use parent 'Exception::Reporter::Summarizer';
  1         0  
  1         4  
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   47 use Try::Tiny;
  1         1  
  1         109  
19              
20 4     4 0 8 sub can_summarize { 1 }
21              
22             sub summarize {
23 4     4 0 4 my ($self, $entry, $internal_arg) = @_;
24 4         6 my ($name, $value, $arg) = @$entry;
25              
26 4         11 my $fn_base = $self->sanitize_filename($name);
27              
28 4         14 my $dump = $self->dump($value, { basename => $fn_base });
29              
30             return {
31 4         29 filename => "$fn_base.txt",
32             ident => "dump of $name",
33             %$dump,
34             };
35             }
36              
37             1;
38              
39             __END__