line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
56
|
|
2
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
73
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Footprintless::InvalidEntityException; |
5
|
|
|
|
|
|
|
$Footprintless::InvalidEntityException::VERSION = '1.29'; |
6
|
|
|
|
|
|
|
# ABSTRACT: An exception thrown when an entity is invalid for the context it is being used in |
7
|
|
|
|
|
|
|
# PODNAME: Footprintless::InvalidEntityException |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
11
|
use Term::ANSIColor; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
94
|
|
10
|
2
|
|
|
2
|
|
8
|
use overload '""' => 'to_string'; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
16
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
2
|
|
|
2
|
1
|
7
|
return bless( {}, shift )->_init(@_); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _init { |
17
|
2
|
|
|
2
|
|
5
|
my ( $self, $coordinate, $message ) = @_; |
18
|
|
|
|
|
|
|
|
19
|
2
|
|
|
|
|
32
|
$self->{coordinate} = $coordinate; |
20
|
2
|
|
|
|
|
5
|
$self->{message} = $message; |
21
|
2
|
|
|
|
|
4
|
$self->{trace} = []; |
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
14
|
return $self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub get_coordinate { |
27
|
0
|
|
|
0
|
1
|
0
|
return $_[0]->{coordinate}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub get_message { |
31
|
2
|
|
|
2
|
1
|
23
|
return $_[0]->{message}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub get_trace { |
35
|
0
|
|
|
0
|
1
|
|
return $_[0]->{trace}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub PROPAGATE { |
39
|
0
|
|
|
0
|
0
|
|
my ( $self, $file, $line ) = @_; |
40
|
0
|
|
|
|
|
|
push( @{ $self->{trace} }, [ $file, $line ] ); |
|
0
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub to_string { |
44
|
0
|
|
|
0
|
1
|
|
my ( $self, $trace ) = @_; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
my @parts = ("invalid entity at [$self->{coordinate}]: $self->{message}"); |
47
|
0
|
0
|
0
|
|
|
|
if ( $trace && @{ $self->{trace} } ) { |
|
0
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
push( @parts, "\n****TRACE****" ); |
49
|
0
|
|
|
|
|
|
foreach my $stop ( @{ $self->{trace} } ) { |
|
0
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
push( @parts, "$stop->[0]($stop->[1])" ); |
51
|
|
|
|
|
|
|
} |
52
|
0
|
|
|
|
|
|
push( @parts, "\n****TRACE****" ); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
return join( '', @parts ); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |