line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
1
|
|
|
1
|
|
85096
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2019'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Moo; |
7
|
1
|
|
|
1
|
|
6
|
use Catmandu::Util qw(is_value); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
8
|
1
|
|
|
1
|
|
272
|
use Catmandu::Util::Path qw(:all); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
9
|
1
|
|
|
1
|
|
351
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
90
|
|
10
|
1
|
|
|
1
|
|
5
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
11
|
1
|
|
|
1
|
|
638
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
12
|
|
|
|
|
|
|
with 'Catmandu::Fix::Builder'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has message => (fix_arg => 1); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my ($self) = @_; |
17
|
|
|
|
|
|
|
my $msg = $self->message; |
18
|
4
|
|
|
4
|
|
28
|
if (looks_like_path($msg)) { |
19
|
4
|
|
|
|
|
12
|
my $getter = as_path($msg)->getter; |
20
|
4
|
100
|
|
|
|
9
|
sub { |
21
|
3
|
|
|
|
|
8
|
my $data = $_[0]; |
22
|
|
|
|
|
|
|
my $vals = $getter->($data); |
23
|
3
|
|
|
3
|
|
5
|
@$vals || return $data; |
24
|
3
|
|
|
|
|
42
|
my $str = join "\n", grep {is_value($_)} @$vals; |
25
|
3
|
100
|
|
|
|
21
|
Catmandu::Error->throw($str); |
26
|
2
|
|
|
|
|
4
|
}; |
|
3
|
|
|
|
|
10
|
|
27
|
2
|
|
|
|
|
10
|
} |
28
|
3
|
|
|
|
|
31
|
else { |
29
|
|
|
|
|
|
|
sub {Catmandu::Error->throw($msg)}; |
30
|
|
|
|
|
|
|
} |
31
|
1
|
|
|
1
|
|
31
|
|
|
1
|
|
|
|
|
12
|
|
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
|
|
|
|
|
|
|
|