lib/AcmeService.php
private function generateException(Response $response, string $body): AcmeException {
        $status = $response->getStatus();
        $info = json_decode($body);
        $uri = $response->getRequest()->getUri();

        if (isset($info->type, $info->detail)) {
            return new AcmeException("Invalid response: {$info->detail}.\nRequest URI: {$uri}.", $info->type);
        }

        return new AcmeException("Invalid response: {$body}.\nRequest URI: {$uri}.", $status);
    }
private function generateException(Response $response, string $body): AcmeException {
        $status = $response->getStatus();
        $info = json_decode($body);
        $uri = $response->getRequest()->getUri();

        if (isset($info->type, $info->detail)) {
            return new AcmeException("Invalid response: {$info->detail}.\nRequest URI: {$uri}.", $info->type);
        }

        return new AcmeException("Invalid response: {$body}.\nRequest URI: {$uri}.", $status);
    }
private function generateException ( Response $ response , string $ body ) : AcmeException { $ status = $ response -> getStatus ( ) ; $ info = json_decode ( $ body ) ; $ uri = $ response -> getRequest ( ) -> getUri ( ) ; if ( isset ( $ info -> type , $ info -> detail ) ) { return new AcmeException ( "Invalid response: {$info->detail}.\nRequest URI: {$uri}." , $ info -> type ) ; } return new AcmeException ( "Invalid response: {$body}.\nRequest URI: {$uri}." , $ status ) ; }
Generates a new exception using the response to provide details.

@param Response $response HTTP response to generate the exception from.
@param string   $body HTTP response body.

@return AcmeException exception generated from the response body
Generates a new exception using the response to provide details .