« blib/lib/WebDyne/Cloudflare/SecretsStore/Error.pm
↑ Summary
blib/lib/WebDyne/Cloudflare/DurableObject/Handler.pm »
| 1 | package WebDyne::Cloudflare::Hyperdrive::Error; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use 5.020; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use overload '""' => 'as_string', fallback => 1; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||
| 8 | 2 | our $VERSION='0.001'; | |||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||
| 10 | 6 | ▶ | sub new { | ||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 11 | 6 | my ($class, %opt)=@_; | |||||||||||||||||||||||||||||||
| 12 | 6 | return bless({ %opt }, $class); | |||||||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||
| 16 | 1 | ▶ | sub code { return shift()->{'code'}; } | ||||||||||||||||||||||||||||||
|
Subroutine
code: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 17 | 1 | ▶ | sub sqlstate { return shift()->{'sqlstate'}; } | ||||||||||||||||||||||||||||||
|
Subroutine
sqlstate: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 18 | 1 | ▶ | sub errno { return shift()->{'errno'}; } | ||||||||||||||||||||||||||||||
|
Subroutine
errno: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 19 | 0 | ▶ | sub message { return shift()->{'message'}; } | ||||||||||||||||||||||||||||||
|
Subroutine
message: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | sub name { return shift()->{'name'}; } | ||||||||||||||||||||||||||||||
|
Subroutine
name: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 21 | 5 | ▶ | sub outcome_unknown { return shift()->{'outcomeUnknown'}||0; } | ||||||||||||||||||||||||||||||
|
Subroutine
outcome_unknown: called CC=2 SCAR=6.9
Pod
undocumented
Condition100%2/2
+(shift())->{'outcomeUnknown'} || 0
MC/DC100%1/1
+(shift())->{'outcomeUnknown'} || 0
+(shift())->{'outcomeUnknown'}
Truth table100%2/2
A
A= +(shift())->{'outcomeUnknown'}
| |||||||||||||||||||||||||||||||||
| 22 | 1 | ▶ | sub details { return { %{$_[0]} }; } | ||||||||||||||||||||||||||||||
|
Subroutine
details: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 23 | 1 | ▶ | sub cause { return shift()->{'cause'}; } | ||||||||||||||||||||||||||||||
|
Subroutine
cause: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 24 | 2 | ▶ | sub cleanup_errors { return [@{$_[0]->{'cleanup_errors'}||[]}]; } | ||||||||||||||||||||||||||||||
|
Subroutine
cleanup_errors: called CC=2 SCAR=7.2
Pod
undocumented
Condition50%1/2
$_[0]{'cleanup_errors'} || []
MC/DC0%0/1
$_[0]{'cleanup_errors'} || []
$_[0]{'cleanup_errors'}
Truth table50%1/2
A
A= $_[0]{'cleanup_errors'}
| |||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||
| 27 | 2 | ▶ | sub with_cleanup { | ||||||||||||||||||||||||||||||
|
Subroutine
with_cleanup: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 28 | 2 | my ($class, $primary_ref, $cleanup_ref)=@_; | |||||||||||||||||||||||||||||||
| 29 | 2 | require Scalar::Util; | |||||||||||||||||||||||||||||||
| 30 | 2 | ▶ | my $error_or=(Scalar::Util::blessed($primary_ref)&&$primary_ref->isa($class)) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($primary_ref) and $primary_ref->isa($class)
MC/DC50%1/2
builtin::blessed($primary_ref) and $primary_ref->isa($class)
builtin::blessed($primary_ref)
$primary_ref->isa($class)
Truth table66%2/3
A and B
A= builtin::blessed($primary_ref)B= $primary_ref->isa($class)
| |||||||||||||||||||||||||||||||||
| 31 | ? $primary_ref : $class->new(name => 'TRANSACTION_ERROR', code => 'CALLBACK_FAILED', | ||||||||||||||||||||||||||||||||
| 32 | message => "$primary_ref", cause => $primary_ref); | ||||||||||||||||||||||||||||||||
| 33 | 2 | push(@{$error_or->{'cleanup_errors'}}, $cleanup_ref); | |||||||||||||||||||||||||||||||
| 34 | 2 | return $error_or; | |||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||
| 38 | 26 | ▶ | sub as_string { | ||||||||||||||||||||||||||||||
|
Subroutine
as_string: called CC=4 SCAR=14.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 39 | 26 | my ($self)=@_; | |||||||||||||||||||||||||||||||
| 40 | return ($self->{'name'}||'HYPERDRIVE_ERROR') . ' [' . | ||||||||||||||||||||||||||||||||
| 41 | 26 | ▶ | ($self->{'code'}||'UNKNOWN') . ']: ' . ($self->{'message'}||'Request failed'); | ||||||||||||||||||||||||||||||
|
Condition66%4/6
$self->{'name'} || 'HYPERDRIVE_ERROR'
$self->{'code'} || 'UNKNOWN'
$self->{'message'} || 'Request failed'
MC/DC100%1/1
$self->{'name'} || 'HYPERDRIVE_ERROR'
$self->{'name'}
MC/DC0%0/1
$self->{'code'} || 'UNKNOWN'
$self->{'code'}
MC/DC0%0/1
$self->{'message'} || 'Request failed'
$self->{'message'}
Truth table100%2/2
A
A= $self->{'name'}
Truth table50%1/2
A
A= $self->{'code'}
Truth table50%1/2
A
A= $self->{'message'}
| |||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||
| 44 | 2 | 1; | |||||||||||||||||||||||||||||||