summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rbot/ircbot.rb21
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index 2f146c29..6f7bed7d 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -940,17 +940,22 @@ class Bot
disconnect(message)
end
- if will_wait
- log "\n\nDisconnected\n\n"
+ begin
+ if will_wait
+ log "\n\nDisconnected\n\n"
- quit if $interrupted > 0
+ quit if $interrupted > 0
- log "\n\nWaiting to reconnect\n\n"
- sleep @config['server.reconnect_wait']
- sleep 10*@config['server.reconnect_wait'] if too_fast
- end
+ log "\n\nWaiting to reconnect\n\n"
+ sleep @config['server.reconnect_wait']
+ sleep 10*@config['server.reconnect_wait'] if too_fast
+ end
- connect
+ connect
+ rescue Exception => e
+ will_wait = true
+ retry
+ end
end
# begin event handling loop