line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# This is a library that loads a bunch of Exception objects |
2
|
|
|
|
|
|
|
package Azure::AD::Error; |
3
|
1
|
|
|
1
|
|
6
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
4
|
1
|
|
|
1
|
|
1418
|
use Types::Standard qw/Str/; |
|
1
|
|
|
|
|
74214
|
|
|
1
|
|
|
|
|
11
|
|
5
|
|
|
|
|
|
|
extends 'Throwable::Error'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has type => (is => 'ro', isa => Str, required => 1); |
8
|
|
|
|
|
|
|
has detail => (is => 'ro'); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub header { |
11
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
12
|
0
|
|
|
|
|
|
return sprintf "Exception with type: %s: %s", $self->type, $self->message; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub as_string { |
16
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
17
|
0
|
0
|
|
|
|
|
if (defined $self->detail) { |
18
|
0
|
|
|
|
|
|
return sprintf "%s\nDetail: %s", $self->header, $self->detail; |
19
|
|
|
|
|
|
|
} else { |
20
|
0
|
|
|
|
|
|
return $self->header; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
package Azure::AD::RemoteError; |
25
|
1
|
|
|
1
|
|
801
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
26
|
1
|
|
|
1
|
|
287
|
use Types::Standard qw/Int/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
27
|
|
|
|
|
|
|
extends 'Azure::AD::Error'; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
has '+type' => (default => sub { 'Remote' }); |
30
|
|
|
|
|
|
|
has status => (is => 'ro', isa => Int, required => 1); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
around header => sub { |
33
|
|
|
|
|
|
|
my ($orig, $self) = @_; |
34
|
|
|
|
|
|
|
my $orig_message = $self->$orig; |
35
|
|
|
|
|
|
|
sprintf "%s with HTTP status %d", $orig_message, $self->status; |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |