blib/lib/Template/Liquid/Error.pm

filter: Statementstmt 36.3% 8 / 22 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 28.5% 2 / 7 Podpod 0.0% 0 / 5 totaltotal 22.7% 10 / 44 CC 6 SCAR 23.4
CC
6
Cov
25%
new
20.0
raise
12.0
message
2.0
CRAP 10.3
« blib/lib/Template/Liquid/Document.pm ↑ Summary blib/lib/Template/Liquid/Filters.pm »
1 package Template::Liquid::Error;
2 25 our $VERSION = '1.0.22';
3 25 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 25 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 0 ▶sub message { return $_[0]->{'message'} }
Subroutine message: not called CC=1 SCAR=6.9
Pod undocumented
6 0 ▶sub fatal { return $_[0]->{'fatal'} }
Subroutine fatal: not called CC=1 SCAR=6.9
Pod undocumented
7  
8 sub new {
9 0 ▶ my ($class, $args) = @_;
Subroutine new: not called CC=4 SCAR=30.0
Pod undocumented
10 0 ▶ $args->{'fatal'} = defined $args->{'fatal'} ? $args->{'fatal'} : 0;
Branch: 1 branch
BranchTrueFalseTotal
defined $args->{'fatal'} ? : 0 0 0
11 0 require Carp;
12 0 Carp::longmess() =~ m[^.+?\n\t(.+)]so;
13 $args->{'message'} = sprintf '%s [%s]: %s %s%s', $class, $args->{'type'},
14 $args->{'message'}, $1,
15 (defined $args->{template}
16 ? sprintf(' (at line %d, column %d)',
17 $args->{template}{line},
18 $args->{template}{column})
19 0 ▶ : ''
Branch: 1 branch
BranchTrueFalseTotal
defined $args->{'template'} ? : 0 0 0
20 );
21 0 ▶ die unless defined $args->{template};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $args->{"template"} 0 0 0
22 0 return bless $args, $class;
23 }
24  
25 sub raise {
26 0 ▶ my ($s) = @_;
Subroutine raise: not called CC=3 SCAR=24.8
Pod undocumented
27 0 ▶ $s = ref $s ? $s : $s->new($_[1]);
Branch: 1 branch
BranchTrueFalseTotal
ref $s ? : 0 0 0
28 0 ▶ die $s->message if $s->fatal;
Branch: 1 branch
BranchTrueFalseTotal
if $s->fatal 0 0 0
29 0 warn $s->message;
30 }
31 0 ▶sub render { $_[0]->{message} }
Subroutine render: not called CC=1 SCAR=6.9
Pod undocumented
32 25 1;
33  
34 =pod
35  
36 =encoding UTF-8
37  
38 =head1 NAME
39  
40 Template::Liquid::Error - General Purpose Error Object
41  
42 =head1 Description
43  
44 This is really only to be used internally.
45  
46 =head1 Author
47  
48 Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/
49  
50 CPAN ID: SANKO
51  
52 =head1 License and Legal
53  
54 Copyright (C) 2009-2022 by Sanko Robinson E<lt>sanko@cpan.orgE<gt>
55  
56 This program is free software; you can redistribute it and/or modify it under
57 the terms of L<The Artistic License
58 2.0|http://www.perlfoundation.org/artistic_license_2_0>. See the F<LICENSE>
59 file included with this distribution or L<notes on the Artistic License
60 2.0|http://www.perlfoundation.org/artistic_2_0_notes> for clarification.
61  
62 When separated from the distribution, all original POD documentation is covered
63 by the L<Creative Commons Attribution-Share Alike 3.0
64 License|http://creativecommons.org/licenses/by-sa/3.0/us/legalcode>. See the
65 L<clarification of the
66 CCA-SA3.0|http://creativecommons.org/licenses/by-sa/3.0/us/>.
67  
68 =cut
« blib/lib/Template/Liquid/Document.pm ↑ Summary blib/lib/Template/Liquid/Filters.pm »