lib/Kubernetes/REST/Error.pm

filter: Statementstmt 100% 17 / 17 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 2 / 2 totaltotal 100% 25 / 25 CC 2 SCAR 3.4
CC
2
Cov
100%
as_string
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« lib/Kubernetes/REST/Role/IO.pm ↑ Summary blib/lib/Kubernetes/REST/Example.pm »
1 package Kubernetes::REST::Error;
2 2 our $VERSION = '1.110';
3 # ABSTRACT: Compatibility helper for deprecated v0 error handling
4 2 ▶ use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶ use Types::Standard qw/Str/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 extends 'Throwable::Error';
7  
8 2 has type => (is => 'ro', isa => Str, required => 1);
9  
10  
11 2 has detail => (is => 'ro');
12  
13  
14 10 ▶ sub header {
Subroutine header: called CC=1 SCAR=0.0
Pod documented
15 10 my $self = shift;
16 10 return sprintf "Exception with type: %s: %s", $self->type, $self->message;
17 }
18  
19  
20 10 ▶ sub as_string {
Subroutine as_string: called CC=2 SCAR=6.9
Pod documented
21 10 my $self = shift;
22 10 ▶ if (defined $self->detail) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->detail) { } 6 4 10
23 6 return sprintf "%s\nDetail: %s", $self->header, $self->detail;
24 } else {
25 4 return $self->header;
26 }
27 }
28  
29  
30  
31 2 1;
32  
33 __END__
« lib/Kubernetes/REST/Role/IO.pm ↑ Summary blib/lib/Kubernetes/REST/Example.pm »