Curl/WsdlGenerator - better error handling

This commit is contained in:
Petr Bechyně 2017-02-18 00:13:02 +01:00
parent 4edc46e67f
commit f276a30a47
2 changed files with 2 additions and 2 deletions

View File

@ -158,7 +158,7 @@ class Curl
$location
);
if (!is_integer($httpResponseCode) || $httpResponseCode >= 400) {
if (!is_integer($httpResponseCode) || $httpResponseCode >= 400 || $httpResponseCode === 0) {
return new CurlResponse(
$httpRequestHeadersAsString,

View File

@ -75,7 +75,7 @@ class WsdlDownloader
$curlResponse = $curl->executeCurlWithCachedSession($wsdlPath);
if ($curlResponse->curlStatusSuccess()) {
if (mb_strlen($curlResponse->getResponseBody()) === 0) {
throw new Exception('Could not write WSDL cache file: curl response empty');
throw new Exception('Could not write WSDL cache file: empty curl response from: '.$wsdlPath);
}
if ($resolveRemoteIncludes === true) {
$document = $this->getXmlFileDOMDocument($curl, $cacheType, $curlResponse->getResponseBody(), $wsdlPath);