diff options
-rw-r--r-- | lib/rbot/ircbot.rb | 7 | ||||
-rw-r--r-- | lib/rbot/ircsocket.rb | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index a48251c2..bd75bec5 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -940,8 +940,11 @@ class Bot quit if $interrupted > 0 @socket.connect @last_rec = Time.now - rescue => e - raise e.class, "failed to connect to IRC server at #{@socket.server_uri}: #{e}" + rescue Exception => e + uri = @socket.server_uri || '<unknown>' + error "failed to connect to IRC server at #{uri}" + error e + raise end quit if $interrupted > 0 diff --git a/lib/rbot/ircsocket.rb b/lib/rbot/ircsocket.rb index 652b1f6d..4c11094b 100644 --- a/lib/rbot/ircsocket.rb +++ b/lib/rbot/ircsocket.rb @@ -401,6 +401,7 @@ module Irc error "error while shutting down: #{e.pretty_inspect}" end @sock = nil + @server_uri = nil @sendq.clear end |