|
@@ -57,7 +57,7 @@ abstract class AbstractProxy
|
|
|
$proxyUrl = $this->_getProxyUrl($conf);
|
|
$proxyUrl = $this->_getProxyUrl($conf);
|
|
|
|
|
|
|
|
if (empty($proxyUrl)) {
|
|
if (empty($proxyUrl)) {
|
|
|
- $this->_error = 'Error calling proxy. Probably a configuration issue, like missing api url';
|
|
|
|
|
|
|
+ $this->_error = 'Error calling proxy. Probably a configuration issue, like wrong or missing config keys.';
|
|
|
error_log($this->_error);
|
|
error_log($this->_error);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -70,20 +70,14 @@ abstract class AbstractProxy
|
|
|
)
|
|
)
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- if ($data == null) {
|
|
|
|
|
- $this->_error = 'Error calling proxy. Probably a configuration issue';
|
|
|
|
|
- error_log($this->_error);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
if ($data === false) {
|
|
if ($data === false) {
|
|
|
$http_response_header = $http_response_header ?? array();
|
|
$http_response_header = $http_response_header ?? array();
|
|
|
$statusCode = '';
|
|
$statusCode = '';
|
|
|
if (!empty($http_response_header) && preg_match('/HTTP\/\d+\.\d+\s+(\d+)/', $http_response_header[0], $matches)) {
|
|
if (!empty($http_response_header) && preg_match('/HTTP\/\d+\.\d+\s+(\d+)/', $http_response_header[0], $matches)) {
|
|
|
$statusCode = $matches[1];
|
|
$statusCode = $matches[1];
|
|
|
}
|
|
}
|
|
|
- $this->_error = 'Error calling proxy. HTTP request failed. Status code: ' . $statusCode;
|
|
|
|
|
- error_log($this->_error);
|
|
|
|
|
|
|
+ $this->_error = 'Error calling proxy. Probably a configuration issue, like wrong or missing config keys.';
|
|
|
|
|
+ error_log($this->_error . ' Status code: ' . $statusCode);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -97,8 +91,8 @@ abstract class AbstractProxy
|
|
|
|
|
|
|
|
$url = $this->_extractShortUrl($jsonData);
|
|
$url = $this->_extractShortUrl($jsonData);
|
|
|
|
|
|
|
|
- if ($url === null) {
|
|
|
|
|
- $this->_error = 'Error calling proxy. Probably a configuration issue, like wrong or missing config keys.';
|
|
|
|
|
|
|
+ if ($url === null || empty($url)) {
|
|
|
|
|
+ $this->_error = 'Error parsing proxy response.';
|
|
|
error_log('Error calling proxy: ' . $data);
|
|
error_log('Error calling proxy: ' . $data);
|
|
|
} else {
|
|
} else {
|
|
|
$this->_url = $url;
|
|
$this->_url = $url;
|