]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/queuemonitor.php
Use ToSelector choice again.
[quix0rs-gnu-social.git] / lib / queuemonitor.php
index 3dc0ea65aa55fb3b89984fe89c17d3dbcac969eb..1790a5cd67585f82236ef10f12b587ac91a44542 100644 (file)
@@ -96,11 +96,16 @@ class QueueMonitor
     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");
         }
     }