From 9b9a36e492523a7fa630475a4a3d46c3d58ffd8c Mon Sep 17 00:00:00 2001 From: Luke Fitzgerald Date: Wed, 28 Jul 2010 11:56:15 -0700 Subject: [PATCH] Introduce error checking when calling handleEvents --- plugins/Irc/ircmanager.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/plugins/Irc/ircmanager.php b/plugins/Irc/ircmanager.php index a54db566a9..8d9cac885b 100644 --- a/plugins/Irc/ircmanager.php +++ b/plugins/Irc/ircmanager.php @@ -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(); + } } /**