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.
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
error "error while shutting down: #{e.pretty_inspect}"
end
@sock = nil
+ @server_uri = nil
@sendq.clear
end