line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Error::Pure::ErrorList; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
77290
|
use base qw(Exporter); |
|
3
|
|
|
|
|
29
|
|
|
3
|
|
|
|
|
416
|
|
4
|
3
|
|
|
3
|
|
22
|
use strict; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
75
|
|
5
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
103
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
1348
|
use Error::Pure::Utils qw(err_helper); |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
1708
|
|
8
|
3
|
|
|
3
|
|
1828
|
use Error::Pure::Output::Text qw(err_line_all); |
|
3
|
|
|
|
|
4572
|
|
|
3
|
|
|
|
|
63
|
|
9
|
3
|
|
|
3
|
|
314
|
use List::Util qw(none); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
343
|
|
10
|
3
|
|
|
3
|
|
21
|
use Readonly; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
733
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Constants. |
13
|
|
|
|
|
|
|
Readonly::Array our @EXPORT_OK => qw(err); |
14
|
|
|
|
|
|
|
Readonly::Scalar my $EVAL => 'eval {...}'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = 0.29; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Process error. |
19
|
|
|
|
|
|
|
sub err { |
20
|
5
|
|
|
5
|
1
|
2658
|
my @msg = @_; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# Get errors structure. |
23
|
5
|
|
|
|
|
17
|
my @errors = err_helper(@msg); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# Finalize in main on last err. |
26
|
5
|
|
|
|
|
12
|
my $stack_ar = $errors[-1]->{'stack'}; |
27
|
5
|
50
|
33
|
|
|
27
|
if ($stack_ar->[-1]->{'class'} eq 'main' |
28
|
10
|
100
|
|
10
|
|
36
|
&& none { $_ eq $EVAL || $_ =~ /^eval '/ms } |
29
|
10
|
|
|
|
|
31
|
map { $_->{'sub'} } @{$stack_ar}) { |
|
5
|
|
|
|
|
13
|
|
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
0
|
die err_line_all(@errors); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# Die for eval. |
34
|
|
|
|
|
|
|
} else { |
35
|
5
|
|
|
|
|
29
|
die "$errors[-1]->{'msg'}->[0]\n"; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |