ACME2/X/ACME.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 20 SCAR 6.9
CC
1
Cov
0%
new
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Net::ACME2::X::ACME;
2  
3 use strict;
4 use warnings;
5  
6 use parent qw( Net::ACME2::X::Generic );
7  
8 #----------------------------------------------------------------------
9 # This class indicates that the ACME server gave an error response.
10 # It should be coincident with a 4xx-level HTTP response.
11 #----------------------------------------------------------------------
12  
13 #named args required:
14 #
15 # http
16 # acme
17 #
18 #optional:
19 # headers
20 #
21 sub new {
22 my ( $self, $args_hr ) = @_;
23  
24 my $http = $args_hr->{'http'};
25  
26 my $http_str = join( ' ', $http->get('status'), $http->get('reason') );
27 my $url = $http->get('url');
28  
29 my $acme_str = $args_hr->{'acme'}->to_string();
30  
31 return $self->SUPER::new(
32 "“$url” indicated an ACME error: $http_str ($acme_str).",
33 $args_hr,
34 );
35 }
36  
37 1;