line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
7
|
|
|
7
|
|
871
|
use 5.12.1; |
|
7
|
|
|
|
|
25
|
|
2
|
7
|
|
|
7
|
|
42
|
use strict; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
147
|
|
3
|
7
|
|
|
7
|
|
33
|
use warnings; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
823
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Opsview::RestAPI::Exception; |
6
|
|
|
|
|
|
|
$Opsview::RestAPI::Exception::VERSION = '1.210260'; |
7
|
|
|
|
|
|
|
# ABSTRACT: Opsview::RestAPI Exception object |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use overload |
11
|
5
|
|
|
5
|
|
2467
|
bool => sub {1}, |
12
|
2
|
|
|
2
|
|
418
|
eq => sub { $_[0]->as_string }, |
13
|
0
|
|
|
0
|
|
0
|
'""' => sub { $_[0]->as_string }, |
14
|
7
|
|
|
7
|
|
92
|
"0+" => sub {1}; |
|
7
|
|
|
0
|
|
16
|
|
|
7
|
|
|
|
|
70
|
|
|
0
|
|
|
|
|
0
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
8
|
|
|
8
|
1
|
5406
|
my ( $class, %args ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
8
|
|
|
|
|
40
|
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
|
|
|
|
|
14
|
do { |
28
|
56
|
|
|
|
|
414
|
my @caller = (caller($i++)); |
29
|
56
|
50
|
|
|
|
137
|
return unless(@caller); |
30
|
|
|
|
|
|
|
|
31
|
56
|
|
|
|
|
81
|
push( @{ $args{callstack} }, { map { $caller_keys[$_] => $caller[$_] } ( 0 .. $#caller_keys) } ); |
|
56
|
|
|
|
|
140
|
|
|
448
|
|
|
|
|
1122
|
|
32
|
|
|
|
|
|
|
} while ( $i < 7 ); |
33
|
|
|
|
|
|
|
|
34
|
8
|
|
|
|
|
407
|
bless { %args }, $class; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
5
|
|
|
5
|
1
|
20246
|
sub line { $_[0]->{callstack}[0]{line} } |
39
|
2
|
|
|
2
|
1
|
7
|
sub path { $_[0]->{callstack}[0]{filename} } |
40
|
3
|
|
|
3
|
1
|
25
|
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
|
139
|
return $_[0]->{message}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub http_code { |
50
|
13
|
|
|
13
|
1
|
681
|
return $_[0]->{http_code}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub as_string { |
55
|
2
|
|
|
2
|
1
|
13
|
my $self = shift; |
56
|
|
|
|
|
|
|
|
57
|
2
|
|
|
|
|
7
|
return sprintf( "Error: %s at %s line %s.\n", |
58
|
|
|
|
|
|
|
$self->message, $self->path, $self->line ); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |