line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
7
|
|
|
7
|
|
983
|
use 5.12.1; |
|
7
|
|
|
|
|
29
|
|
2
|
7
|
|
|
7
|
|
43
|
use strict; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
147
|
|
3
|
7
|
|
|
7
|
|
35
|
use warnings; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
956
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Opsview::RestAPI::Exception; |
6
|
|
|
|
|
|
|
$Opsview::RestAPI::Exception::VERSION = '1.210670'; |
7
|
|
|
|
|
|
|
# ABSTRACT: Opsview::RestAPI Exception object |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use overload |
11
|
5
|
|
|
5
|
|
2414
|
bool => sub {1}, |
12
|
2
|
|
|
2
|
|
429
|
eq => sub { $_[0]->as_string }, |
13
|
0
|
|
|
0
|
|
0
|
'""' => sub { $_[0]->as_string }, |
14
|
7
|
|
|
7
|
|
92
|
"0+" => sub {1}; |
|
7
|
|
|
0
|
|
16
|
|
|
7
|
|
|
|
|
87
|
|
|
0
|
|
|
|
|
0
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
8
|
|
|
8
|
1
|
6086
|
my ( $class, %args ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
8
|
|
|
|
|
38
|
my @caller_keys = ( |
21
|
|
|
|
|
|
|
qw/ package filename line subroutine hasargs wantarray evaltext is_require / |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
#hints bitmask hinthash / |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# Build up the callstack to a max of 7 levels |
26
|
8
|
|
|
|
|
18
|
my $i=0; |
27
|
8
|
|
|
|
|
53
|
do { |
28
|
56
|
|
|
|
|
375
|
my @caller = (caller($i++)); |
29
|
56
|
50
|
|
|
|
142
|
return unless(@caller); |
30
|
|
|
|
|
|
|
|
31
|
56
|
|
|
|
|
86
|
push( @{ $args{callstack} }, { map { $caller_keys[$_] => $caller[$_] } ( 0 .. $#caller_keys) } ); |
|
56
|
|
|
|
|
140
|
|
|
448
|
|
|
|
|
1124
|
|
32
|
|
|
|
|
|
|
} while ( $i < 7 ); |
33
|
|
|
|
|
|
|
|
34
|
8
|
|
|
|
|
438
|
bless { %args }, $class; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
5
|
|
|
5
|
1
|
22007
|
sub line { $_[0]->{callstack}[0]{line} } |
39
|
2
|
|
|
2
|
1
|
26
|
sub path { $_[0]->{callstack}[0]{filename} } |
40
|
3
|
|
|
3
|
1
|
34
|
sub filename { $_[0]->{callstack}[0]{filename} } |
41
|
0
|
|
|
0
|
1
|
0
|
sub package { $_[0]->{callstack}[0]{package} } |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub message { |
45
|
15
|
|
|
15
|
1
|
142
|
return $_[0]->{message}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub http_code { |
50
|
13
|
|
|
13
|
1
|
709
|
return $_[0]->{http_code}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub as_string { |
55
|
2
|
|
|
2
|
1
|
14
|
my $self = shift; |
56
|
|
|
|
|
|
|
|
57
|
2
|
|
|
|
|
8
|
return sprintf( "Error: %s at %s line %s.\n", |
58
|
|
|
|
|
|
|
$self->message, $self->path, $self->line ); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |