| 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; |