| 1 | # This is a library that loads a bunch of Exception objects | ||||||||||
| 2 | package Azure::AD::Error; | ||||||||||
| 3 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Types::Standard qw/Str/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | extends 'Throwable::Error'; | |||||||||
| 6 | |||||||||||
| 7 | 1 | has type => (is => 'ro', isa => Str, required => 1); | |||||||||
| 8 | 1 | has detail => (is => 'ro'); | |||||||||
| 9 | |||||||||||
| 10 | sub header { | ||||||||||
| 11 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
header: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 12 | 0 | return sprintf "Exception with type: %s: %s", $self->type, $self->message; | |||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | sub as_string { | ||||||||||
| 16 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
as_string: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 17 | 0 | ▶ | if (defined $self->detail) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 26 | 1 | ▶ | use Types::Standard qw/Int/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 27 | 1 | extends 'Azure::AD::Error'; | |||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | has '+type' => (default => sub { 'Remote' }); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 30 | 1 | has status => (is => 'ro', isa => Int, required => 1); | |||||||||
| 31 | |||||||||||
| 32 | around header => sub { | ||||||||||
| 33 | 0 | ▶ | my ($orig, $self) = @_; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 34 | 0 | my $orig_message = $self->$orig; | |||||||||
| 35 | 0 | sprintf "%s with HTTP status %d", $orig_message, $self->status; | |||||||||
| 36 | 1 | }; | |||||||||
| 37 | |||||||||||
| 38 | 1 | 1; | |||||||||