line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
1
|
|
|
1
|
|
89439
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2018'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Moo; |
7
|
1
|
|
|
1
|
|
6
|
use Catmandu::Util qw(is_value); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
8
|
1
|
|
|
1
|
|
297
|
use Catmandu::Util::Path qw(:all); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
9
|
1
|
|
|
1
|
|
373
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
96
|
|
10
|
1
|
|
|
1
|
|
12
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
11
|
1
|
|
|
1
|
|
646
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
12
|
|
|
|
|
|
|
with 'Catmandu::Fix::Builder'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has message => (fix_arg => 1); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my ($self) = @_; |
17
|
|
|
|
|
|
|
my $msg = $self->message; |
18
|
4
|
|
|
4
|
|
35
|
if (looks_like_path($msg)) { |
19
|
4
|
|
|
|
|
11
|
my $getter = as_path($msg)->getter; |
20
|
4
|
100
|
|
|
|
10
|
sub { |
21
|
3
|
|
|
|
|
10
|
my $data = $_[0]; |
22
|
|
|
|
|
|
|
my $vals = $getter->($data); |
23
|
3
|
|
|
3
|
|
5
|
@$vals || return $data; |
24
|
3
|
|
|
|
|
43
|
my $str = join "\n", grep {is_value($_)} @$vals; |
25
|
3
|
100
|
|
|
|
25
|
Catmandu::Error->throw($str); |
26
|
2
|
|
|
|
|
6
|
}; |
|
3
|
|
|
|
|
13
|
|
27
|
2
|
|
|
|
|
12
|
} |
28
|
3
|
|
|
|
|
31
|
else { |
29
|
|
|
|
|
|
|
sub {Catmandu::Error->throw($msg)}; |
30
|
|
|
|
|
|
|
} |
31
|
1
|
|
|
1
|
|
34
|
|
|
1
|
|
|
|
|
17
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=pod |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 NAME |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Catmandu::Fix::error - die with an error message |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 SYNOPSIS |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
unless exists(id) |
46
|
|
|
|
|
|
|
error('id missing!') |
47
|
|
|
|
|
|
|
end |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# get the value from a path |
50
|
|
|
|
|
|
|
error($.error) |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 SEE ALSO |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
L<Catmandu::Fix> |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
57
|
|
|
|
|
|
|
|