File Coverage

blib/lib/Template/Liquid/Error.pm
Criterion Covered Total %
statement 6 20 30.0
branch 0 10 0.0
condition n/a
subroutine 2 7 28.5
pod 0 5 0.0
total 8 42 19.0


line stmt bran cond sub pod time code
1             our $VERSION = '1.0.22';
2             use strict;
3 25     25   152 use warnings;
  25         39  
  25         610  
4 25     25   107  
  25         39  
  25         7337  
5 0     0 0   my ($class, $args) = @_;
6 0     0 0   $args->{'fatal'} = defined $args->{'fatal'} ? $args->{'fatal'} : 0;
7             require Carp;
8             Carp::longmess() =~ m[^.+?\n\t(.+)]so;
9 0     0 0   $args->{'message'} = sprintf '%s [%s]: %s %s%s', $class, $args->{'type'},
10 0 0         $args->{'message'}, $1,
11 0           (defined $args->{template}
12 0           ? sprintf(' (at line %d, column %d)',
13             $args->{template}{line},
14             $args->{template}{column})
15             : ''
16             );
17             die unless defined $args->{template};
18             return bless $args, $class;
19 0 0         }
20              
21 0 0         my ($s) = @_;
22 0           $s = ref $s ? $s : $s->new($_[1]);
23             die $s->message if $s->fatal;
24             warn $s->message;
25             }
26 0     0 0   1;
27 0 0          
28 0 0         =pod
29 0            
30             =encoding UTF-8
31 0     0 0    
32             =head1 NAME
33              
34             Template::Liquid::Error - General Purpose Error Object
35              
36             =head1 Description
37              
38             This is really only to be used internally.
39              
40             =head1 Author
41              
42             Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/
43              
44             CPAN ID: SANKO
45              
46             =head1 License and Legal
47              
48             Copyright (C) 2009-2022 by Sanko Robinson E<lt>sanko@cpan.orgE<gt>
49              
50             This program is free software; you can redistribute it and/or modify it under
51             the terms of L<The Artistic License
52             2.0|http://www.perlfoundation.org/artistic_license_2_0>. See the F<LICENSE>
53             file included with this distribution or L<notes on the Artistic License
54             2.0|http://www.perlfoundation.org/artistic_2_0_notes> for clarification.
55              
56             When separated from the distribution, all original POD documentation is covered
57             by the L<Creative Commons Attribution-Share Alike 3.0
58             License|http://creativecommons.org/licenses/by-sa/3.0/us/legalcode>. See the
59             L<clarification of the
60             CCA-SA3.0|http://creativecommons.org/licenses/by-sa/3.0/us/>.
61              
62             =cut