line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Error::Pure::AllError; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
76311
|
use base qw(Exporter); |
|
3
|
|
|
|
|
18
|
|
|
3
|
|
|
|
|
397
|
|
4
|
3
|
|
|
3
|
|
21
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
58
|
|
5
|
3
|
|
|
3
|
|
24
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
101
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
1318
|
use Error::Pure::Utils qw(err_helper); |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
65
|
|
8
|
3
|
|
|
3
|
|
1841
|
use Error::Pure::Output::Text qw(err_bt_pretty); |
|
3
|
|
|
|
|
6129
|
|
|
3
|
|
|
|
|
71
|
|
9
|
3
|
|
|
3
|
|
263
|
use List::Util qw(none); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
332
|
|
10
|
3
|
|
|
3
|
|
22
|
use Readonly; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
801
|
|
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
|
2082
|
my @msg = @_; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# Get errors structure. |
23
|
5
|
|
|
|
|
20
|
my @errors = err_helper(@msg); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# Finalize in main on last err. |
26
|
5
|
|
|
|
|
13
|
my $stack_ar = $errors[-1]->{'stack'}; |
27
|
5
|
50
|
33
|
|
|
29
|
if ($stack_ar->[-1]->{'class'} eq 'main' |
28
|
10
|
100
|
|
10
|
|
43
|
&& none { $_ eq $EVAL || $_ =~ m/^eval '/ms } |
29
|
10
|
|
|
|
|
32
|
map { $_->{'sub'} } @{$stack_ar}) { |
|
5
|
|
|
|
|
10
|
|
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
0
|
die scalar err_bt_pretty(@errors); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# Die for eval. |
34
|
|
|
|
|
|
|
} else { |
35
|
5
|
|
|
|
|
43
|
die "$errors[-1]->{'msg'}->[0]\n"; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |