diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-06-11 16:26:09 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-06-11 16:26:09 +0200 |
commit | 2a3bc07d139593f1f57e23cfbd08602d29a8b26c (patch) | |
tree | 5120a20bd222d12d15b960862b853a196add997a /lib/rbot/ircbot.rb | |
parent | 1fbb090ea91ab20916b3698d8afd6e300673b826 (diff) |
Saner treatment for connect errors
Rather than raising changing the message (a message that would not be
displayed anyway), display the (composed) error message and then reraise
without further changes.
Diffstat (limited to 'lib/rbot/ircbot.rb')
-rw-r--r-- | lib/rbot/ircbot.rb | 7 |
1 files changed, 5 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 |