line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bot::Cobalt::Error; |
2
|
|
|
|
|
|
|
$Bot::Cobalt::Error::VERSION = '0.021001'; |
3
|
2
|
|
|
2
|
|
491
|
use v5.10; |
|
2
|
|
|
|
|
4
|
|
4
|
2
|
|
|
2
|
|
366
|
use strictures 2; |
|
2
|
|
|
|
|
1074
|
|
|
2
|
|
|
|
|
58
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
1041
|
use Devel::StackTrace; |
|
2
|
|
|
|
|
4397
|
|
|
2
|
|
|
|
|
67
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use overload |
9
|
0
|
|
|
0
|
|
0
|
bool => sub { 1 }, |
10
|
2
|
|
|
|
|
9
|
'""' => 'string', |
11
|
2
|
|
|
2
|
|
9
|
fallback => 1 ; |
|
2
|
|
|
|
|
2
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub TRACE () { 0 } |
15
|
|
|
|
|
|
|
sub ARRAY () { 1 } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub __new_trace { |
18
|
12
|
|
|
12
|
|
24
|
Devel::StackTrace->new( |
19
|
|
|
|
|
|
|
ignore_class => __PACKAGE__, |
20
|
|
|
|
|
|
|
no_refs => 1, |
21
|
|
|
|
|
|
|
) |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub new { |
25
|
11
|
|
|
11
|
0
|
1222
|
my $class = shift; |
26
|
11
|
|
|
|
|
12
|
my $trace = $class->__new_trace; |
27
|
11
|
|
66
|
|
|
1123
|
bless [ |
28
|
|
|
|
|
|
|
$trace, ## TRACE |
29
|
|
|
|
|
|
|
[ @_ ], ## ARRAY |
30
|
|
|
|
|
|
|
], ref $class || $class |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub trace { |
34
|
3
|
|
|
3
|
1
|
208
|
my ($self) = @_; |
35
|
3
|
|
|
|
|
8
|
$self->[TRACE] |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _set_trace { |
39
|
1
|
|
|
1
|
|
115
|
my ($self, $trace) = @_; |
40
|
1
|
|
|
|
|
1
|
$self->[TRACE] = $trace; |
41
|
1
|
|
|
|
|
11
|
$self |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub throw { |
45
|
1
|
|
|
1
|
1
|
50
|
my ($self) = @_; |
46
|
1
|
|
|
|
|
3
|
die $self->_set_trace( $self->__new_trace ) |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub string { |
50
|
10
|
|
|
10
|
1
|
1143
|
join '', map { "$_" } @{ $_[0]->[ARRAY] } |
|
15
|
|
|
|
|
113
|
|
|
10
|
|
|
|
|
20
|
|
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub push { |
54
|
3
|
|
|
3
|
1
|
202
|
my $self = shift; |
55
|
3
|
|
|
|
|
3
|
push @{ $self->[ARRAY] }, @_; |
|
3
|
|
|
|
|
4
|
|
56
|
3
|
|
|
|
|
8
|
$self |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub unshift { |
60
|
2
|
|
|
2
|
1
|
2
|
my $self = shift; |
61
|
2
|
|
|
|
|
2
|
unshift @{ $self->[ARRAY] }, @_; |
|
2
|
|
|
|
|
3
|
|
62
|
2
|
|
|
|
|
5
|
$self |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub slice { |
66
|
1
|
|
|
1
|
1
|
1
|
my $self = shift; |
67
|
1
|
|
|
|
|
1
|
$self->new( @{ $self->[ARRAY] }[@_] ) |
|
1
|
|
|
|
|
2
|
|
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub join { |
71
|
4
|
|
|
4
|
1
|
178
|
my ($self, $delim) = @_; |
72
|
4
|
|
100
|
|
|
12
|
$self->new( join($delim //= ' ', map { "$_" } @{ $self->[ARRAY] }) ) |
|
10
|
|
|
|
|
17
|
|
|
4
|
|
|
|
|
7
|
|
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
__END__ |