]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Introduce error checking when calling handleEvents
authorLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Wed, 28 Jul 2010 18:56:15 +0000 (11:56 -0700)
committerLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Wed, 28 Jul 2010 18:56:15 +0000 (11:56 -0700)
plugins/Irc/ircmanager.php

index a54db566a9817bed70c483a28fae02fb408a83cf..8d9cac885b3998a068036189744f666d74b0a317 100644 (file)
@@ -72,7 +72,11 @@ class IrcManager extends ImManager {
      */
     public function idle() {
         // Call Phergie's doTick methods if necessary
-        $this->conn->handleEvents();
+        try {
+            $this->conn->handleEvents();
+        } catch (Phergie_Driver_Exception $e) {
+            $this->conn->reconnect();
+        }
     }
 
     /**
@@ -84,7 +88,12 @@ class IrcManager extends ImManager {
     public function handleInput($socket) {
         common_log(LOG_DEBUG, 'Servicing the IRC queue.');
         $this->stats('irc_process');
-        $this->conn->handleEvents();
+
+        try {
+            $this->conn->handleEvents();
+        } catch (Phergie_Driver_Exception $e) {
+            $this->conn->reconnect();
+        }
     }
 
     /**