| 1 | package InternetData::OauthError; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 8 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 8 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 8 | ▶ | use parent 'InternetData::Error'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 8 | our $VERSION = '1.15.0'; | |||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | # The authorization server refused an OAuth request, with the reason it gave. | ||||||||||||||||||||
| 11 | # `kind` follows the status like any other failure's. Never retryable: every | ||||||||||||||||||||
| 12 | # refusal answers the request exactly as it was sent. | ||||||||||||||||||||
| 13 | 32 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||
| 14 | 32 | my ($class, %args) = @_; | |||||||||||||||||||
| 15 | 32 | my $code = $args{error_code}; | |||||||||||||||||||
| 16 | 32 | my $description = $args{error_description}; | |||||||||||||||||||
| 17 | my $self = $class->SUPER::new( | ||||||||||||||||||||
| 18 | kind => $args{kind} || 'bad_request', | ||||||||||||||||||||
| 19 | status => $args{status}, | ||||||||||||||||||||
| 20 | 32 | ▶ | message => defined $description ? "$code: $description" : $code, | ||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$args{'kind'} || 'bad_request'
MC/DC100%1/1
$args{'kind'} || 'bad_request'
$args{'kind'}
Truth table100%2/2
A
A= $args{'kind'}
| |||||||||||||||||||||
| 21 | ); | ||||||||||||||||||||
| 22 | 32 | $self->{error_code} = $code; | |||||||||||||||||||
| 23 | 32 | $self->{error_description} = $description; | |||||||||||||||||||
| 24 | 32 | return $self; | |||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | # The subtype for a refusal. A code we have never seen stays this base type. | ||||||||||||||||||||
| 28 | 25 | ▶ | sub _from { | ||||||||||||||||||
|
Subroutine
_from: called CC=3 SCAR=11.0
| |||||||||||||||||||||
| 29 | 25 | my ($class, %args) = @_; | |||||||||||||||||||
| 30 | my $type = $args{error_code} eq 'access_denied' ? 'InternetData::OauthAccessDeniedError' | ||||||||||||||||||||
| 31 | 25 | ▶ | : $args{error_code} eq 'expired_token' ? 'InternetData::OauthExpiredTokenError' | ||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||
| 32 | : $class; | ||||||||||||||||||||
| 33 | 25 | return $type->new(%args); | |||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 34 | ▶ | sub error_code { $_[0]->{error_code} } | ||||||||||||||||||
|
Subroutine
error_code: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 37 | 11 | ▶ | sub error_description { $_[0]->{error_description} } | ||||||||||||||||||
|
Subroutine
error_description: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 38 | 15 | ▶ | sub retryable { 0 } | ||||||||||||||||||
|
Subroutine
retryable: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | package InternetData::OauthAccessDeniedError; | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 8 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 43 | 8 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 8 | our @ISA = ('InternetData::OauthError'); | |||||||||||||||||||
| 46 | 8 | our $VERSION = '1.15.0'; | |||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | package InternetData::OauthExpiredTokenError; | ||||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | 8 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 51 | 8 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | 8 | our @ISA = ('InternetData::OauthError'); | |||||||||||||||||||
| 54 | 8 | our $VERSION = '1.15.0'; | |||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | 8 | 1; | |||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | __END__ | ||||||||||||||||||||