summaryrefslogtreecommitdiff
path: root/plugins/Irc/ircmanager.php
diff options
context:
space:
mode:
authorLuke Fitzgerald <lw.fitzgerald@googlemail.com>2010-07-28 11:56:15 -0700
committerLuke Fitzgerald <lw.fitzgerald@googlemail.com>2010-07-28 11:56:15 -0700
commit9b9a36e492523a7fa630475a4a3d46c3d58ffd8c (patch)
treeead1db3076719ebf3d336dca784d04716230ad9f /plugins/Irc/ircmanager.php
parent2fe1b128043d5a4056d68b555c6e9de9c646baa9 (diff)
Introduce error checking when calling handleEvents
Diffstat (limited to 'plugins/Irc/ircmanager.php')
-rw-r--r--plugins/Irc/ircmanager.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/Irc/ircmanager.php b/plugins/Irc/ircmanager.php
index a54db566a..8d9cac885 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();
+ }
}
/**