File Coverage

blib/lib/Taskwarrior/Kusarigama/Wrapper/Exception.pm
Criterion Covered Total %
statement 9 22 40.9
branch 0 2 0.0
condition n/a
subroutine 3 8 37.5
pod 0 4 0.0
total 12 36 33.3


line stmt bran cond sub pod time code
1             package Taskwarrior::Kusarigama::Wrapper::Exception;
2             our $AUTHORITY = 'cpan:YANICK';
3             # ABSTRACT: Exception class for Taskwarrior::Kusarigama::Wrapper
4             $Taskwarrior::Kusarigama::Wrapper::Exception::VERSION = '0.11.0';
5 2     2   14 use strict;
  2         5  
  2         60  
6 2     2   10 use warnings;
  2         3  
  2         122  
7              
8 0     0 0   sub new { my $class = shift; bless { @_ } => $class }
  0            
9              
10             use overload (
11 2         12 q("") => '_stringify',
12             fallback => 1,
13 2     2   2262 );
  2         1844  
14              
15             sub _stringify {
16 0     0     my ($self) = @_;
17 0           my $error = $self->error;
18 0 0         return $error if $error =~ /\S/;
19 0           return "task exited non-zero but had no output to stderr";
20             }
21              
22 0     0 0   sub output { join "", map { "$_\n" } @{ shift->{output} } }
  0            
  0            
23              
24 0     0 0   sub error { join "", map { "$_\n" } @{ shift->{error} } }
  0            
  0            
25              
26 0     0 0   sub status { shift->{status} }
27              
28             1;
29              
30             __END__
31              
32             =pod
33              
34             =encoding UTF-8
35              
36             =head1 NAME
37              
38             Taskwarrior::Kusarigama::Wrapper::Exception - Exception class for Taskwarrior::Kusarigama::Wrapper
39              
40             =head1 VERSION
41              
42             version 0.11.0
43              
44             =head1 AUTHOR
45              
46             Yanick Champoux <yanick@cpan.org>
47              
48             =head1 COPYRIGHT AND LICENSE
49              
50             This software is copyright (c) 2018, 2017 by Yanick Champoux.
51              
52             This is free software; you can redistribute it and/or modify it under
53             the same terms as the Perl 5 programming language system itself.
54              
55             =cut