Docker/Error/Truncated.pm

filter: Statementstmt 88.0% 22 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 6 / 9 Podpod 100% 1 / 1 totaltotal 82.8% 29 / 35 CC 1 SCAR 2.9
CC
1
Cov
88%
__ANON__
2.0
__ANON__
2.0
__ANON__
2.0
CRAP 1.3
« Docker/Role/Entity/Secret.pm ↑ Summary Docker/Error/Stream.pm »
1 package API::Docker::Error::Truncated;
2 # ABSTRACT: The daemon closed before the response it announced was complete
3 52 our $VERSION = '0.006';
4 52 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 # namespace::clean has to come BEFORE "use overload" here, not after it as
6 # everywhere else in this distribution -- same reason as in
7 # API::Docker::Error::Stream, API::Docker::Error::HTTP and
8 # API::Docker::Error::Timeout. It sweeps the symbols `overload` installs --
9 # the `("" ` slot among them -- so with the two lines in the house order the
10 # class ends up not overloaded at all and stringifies as
11 # API::Docker::Error::Truncated=HASH(0x...). Nothing dies when that happens:
12 # every caller that only inspects $@ as a string silently starts seeing a
13 # reference address instead of the reason. Measured, not assumed:
14 # overload::Overloaded($err) is false with the lines swapped.
15 52 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 use overload
17 37 ▶ '""' => sub { $_[0]->as_string },
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
18 122 ▶ 'bool' => sub { 1 },
Subroutine __ANON__: called CC=1 SCAR=0.0
19 52 fallback => 1;
20  
21  
22 52 has message => (
23 is => 'ro',
24 required => 1,
25 );
26  
27  
28 has location => (
29 is => 'ro',
30 0 ▶ default => sub { '' },
Subroutine __ANON__: not called CC=1 SCAR=6.9
31 52 );
32  
33  
34 has endpoint => (
35 is => 'ro',
36 0 ▶ default => sub { '' },
Subroutine __ANON__: not called CC=1 SCAR=6.9
37 52 );
38  
39  
40 52 has phase => (
41 is => 'ro',
42 required => 1,
43 );
44  
45  
46 52 has expected => (
47 is => 'ro',
48 );
49  
50  
51 52 has received => (
52 is => 'ro',
53 );
54  
55  
56 has partial => (
57 is => 'ro',
58 0 ▶ default => sub { '' },
Subroutine __ANON__: not called CC=1 SCAR=6.9
59 52 );
60  
61  
62 52 has summary => (
63 is => 'ro',
64 );
65  
66  
67 38 ▶sub as_string { $_[0]->message . $_[0]->location }
Subroutine as_string: called CC=1 SCAR=0.0
Pod documented
68  
69  
70  
71 52 1;
72  
73 __END__
« Docker/Role/Entity/Secret.pm ↑ Summary Docker/Error/Stream.pm »