private function checkForOaipmhException(HttpException $httpException)
    {
        try {
            if ($resp = $httpException->getBody()) {
                $this->decodeResponse($resp); // Throw OaipmhException in case of an error
            }
        } catch (MalformedResponseException $e) {
            // There was no valid OAI error in the response, therefore re-throw HttpException
        }

        throw $httpException;
    }