protected function pingHttp($target, $data)
{
$client = new HTTPClient();
- $result = $client->post($target, array(), $data);
+ try {
+ $result = $client->post($target, array(), $data);
- if (!$result->isOk()) {
- common_log(LOG_ERR, __METHOD__ . ' HTTP ' . $result->getStatus() .
- ': ' . $result->getBody());
+ if (!$result->isOk()) {
+ common_log(LOG_ERR, __METHOD__ . ' HTTP ' . $result->getStatus() . ': ' . $result->getBody());
+ }
+ } catch (NoHttpResponseException $e) {
+ common_log(LOG_ERR, __METHOD__ . ':'.$e->getMessage());
+ } catch (HTTP_Request2_Exception $e) {
+ common_log(LOG_ERR, __CLASS__ . ": Invalid $code redirect from $url to $target");
}
}