line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
11
|
use Moops -strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
22
|
|
2
|
2
|
|
|
2
|
|
3367
|
use Throwable (); |
|
2
|
|
|
|
|
2142
|
|
|
2
|
|
|
|
|
55
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: exception class for WebService::Intercom |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=pod |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
WebService::Intercom::Exception - represent a exception or error |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPSIS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Not useful to create on its own. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head2 ATTRIBUTES |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=over |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=item message - the error message |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=item stack - stack trace of the error. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=item code - the code of the error if any |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=item request_id - the request id of the error if available |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=back |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
2
|
|
|
2
|
|
180772
|
class WebService::Intercom::Exception with ::Throwable { |
|
2
|
|
|
2
|
|
68
|
|
|
2
|
|
|
2
|
|
18
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
233
|
|
|
2
|
|
|
|
|
1259
|
|
|
2
|
|
|
|
|
3424
|
|
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
2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|
|
|
34
|
2
|
|
|
|
|
88
|
my %CarpInternal = ("WebService::Intercom::Exception" => 1, |
35
|
|
|
|
|
|
|
"Throwable" => 1); |
36
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
11
|
has 'code' => (is => 'ro'); |
38
|
2
|
|
|
|
|
3301
|
has 'request_id' => (is => 'ro'); |
39
|
2
|
|
|
|
|
497
|
has 'message' => (is => 'ro', isa => 'Maybe[Str]', required => 1); |
40
|
|
|
|
|
|
|
has 'stack' => (is => 'ro', default => sub { |
41
|
0
|
|
|
|
|
|
my ($level, @caller, %ctxt) = 0; |
42
|
0
|
|
0
|
|
|
|
while ( |
43
|
|
|
|
|
|
|
defined scalar caller($level) and $CarpInternal{scalar caller($level)} |
44
|
|
|
|
|
|
|
) { |
45
|
0
|
|
|
|
|
|
$level++; |
46
|
|
|
|
|
|
|
} |
47
|
0
|
|
|
|
|
|
@ctxt{qw/ package file line /} = caller($level); |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
my $stack = undef; |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
$stack = "Devel::StackTrace"->new( |
52
|
|
|
|
|
|
|
ignore_package => [ keys %CarpInternal] |
53
|
|
|
|
|
|
|
); |
54
|
0
|
|
|
|
|
|
return $stack; |
55
|
2
|
|
|
|
|
30255
|
}); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
use overload fallback => 1, |
58
|
|
|
|
|
|
|
'""' => sub { |
59
|
0
|
|
|
0
|
|
0
|
my $e = shift; |
60
|
0
|
|
|
|
|
0
|
my $msg = "WebService::Intercom::Exception: @{[$e->message]}\n"; |
|
0
|
|
|
|
|
0
|
|
61
|
0
|
|
|
|
|
0
|
$msg .= "Stack: " . $e->stack . "\n"; |
62
|
0
|
|
|
|
|
0
|
return $msg; |
63
|
2
|
|
|
2
|
|
11
|
}; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
22
|
|
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|