line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Error::Pure::ANSIColor::AllError; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
74839
|
use base qw(Exporter); |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
269
|
|
4
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
38
|
|
5
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
94
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
1012
|
use Error::Pure::Utils qw(err_helper); |
|
2
|
|
|
|
|
12019
|
|
|
2
|
|
|
|
|
45
|
|
8
|
2
|
|
|
2
|
|
1222
|
use Error::Pure::Output::ANSIColor qw(err_bt_pretty); |
|
2
|
|
|
|
|
24542
|
|
|
2
|
|
|
|
|
42
|
|
9
|
2
|
|
|
2
|
|
165
|
use List::Util qw(none); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
207
|
|
10
|
2
|
|
|
2
|
|
14
|
use Readonly; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
537
|
|
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
|
0
|
|
|
0
|
1
|
|
my @msg = @_; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# Get errors structure. |
23
|
0
|
|
|
|
|
|
my @errors = err_helper(@msg); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# Finalize in main on last err. |
26
|
0
|
|
|
|
|
|
my $stack_ar = $errors[-1]->{'stack'}; |
27
|
0
|
0
|
0
|
|
|
|
if ($stack_ar->[-1]->{'class'} eq 'main' |
28
|
0
|
0
|
|
0
|
|
|
&& none { $_ eq $EVAL || $_ =~ m/^eval '/ms } |
29
|
0
|
|
|
|
|
|
map { $_->{'sub'} } @{$stack_ar}) { |
|
0
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
die scalar err_bt_pretty(@errors); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# Die for eval. |
34
|
|
|
|
|
|
|
} else { |
35
|
0
|
|
|
|
|
|
die "$errors[-1]->{'msg'}->[0]\n"; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |