Curl/WsdlGenerator - better error handling
This commit is contained in:
parent
4edc46e67f
commit
f276a30a47
|
@ -158,7 +158,7 @@ class Curl
|
||||||
$location
|
$location
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!is_integer($httpResponseCode) || $httpResponseCode >= 400) {
|
if (!is_integer($httpResponseCode) || $httpResponseCode >= 400 || $httpResponseCode === 0) {
|
||||||
|
|
||||||
return new CurlResponse(
|
return new CurlResponse(
|
||||||
$httpRequestHeadersAsString,
|
$httpRequestHeadersAsString,
|
||||||
|
|
|
@ -75,7 +75,7 @@ class WsdlDownloader
|
||||||
$curlResponse = $curl->executeCurlWithCachedSession($wsdlPath);
|
$curlResponse = $curl->executeCurlWithCachedSession($wsdlPath);
|
||||||
if ($curlResponse->curlStatusSuccess()) {
|
if ($curlResponse->curlStatusSuccess()) {
|
||||||
if (mb_strlen($curlResponse->getResponseBody()) === 0) {
|
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) {
|
if ($resolveRemoteIncludes === true) {
|
||||||
$document = $this->getXmlFileDOMDocument($curl, $cacheType, $curlResponse->getResponseBody(), $wsdlPath);
|
$document = $this->getXmlFileDOMDocument($curl, $cacheType, $curlResponse->getResponseBody(), $wsdlPath);
|
||||||
|
|
Loading…
Reference in New Issue