X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fircsocket.rb;h=dcc501a36657fe9ba2241f1506d8707d989bee17;hb=700865086123f58833f7d83033e0a1ede1d40e0f;hp=b825a76863770a5b316f9798ef61cb0b6ba19f0b;hpb=c5c4032d51e76c9e39fb0f1df0b50d4b394dadf8;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/ircsocket.rb b/lib/rbot/ircsocket.rb index b825a768..dcc501a3 100644 --- a/lib/rbot/ircsocket.rb +++ b/lib/rbot/ircsocket.rb @@ -395,13 +395,12 @@ module Irc end end - def handle_socket_error(string, err) - error "#{string} failed: #{err.inspect}" - debug err.backtrace.join("\n") + def handle_socket_error(string, e) + error "#{string} failed: #{e.pretty_inspect}" # We assume that an error means that there are connection # problems and that we should reconnect, so we shutdown - raise SocketError.new(err.inspect) + raise SocketError.new(e.inspect) end # get the next line from the server (blocks) @@ -416,7 +415,7 @@ module Irc reply.strip! if reply debug "RECV: #{reply.inspect}" return reply - rescue => e + rescue Exception => e handle_socket_error(:RECV, e) end end @@ -461,9 +460,8 @@ module Irc if @sendq.empty? @timer.stop end - rescue => e - error "Spooling failed: #{e.inspect}" - error e.backtrace.join("\n") + rescue Exception => e + error "Spooling failed: #{e.pretty_inspect}" end end end @@ -495,9 +493,8 @@ module Irc return unless connected? begin @sock.close - rescue => err - error "error while shutting down: #{err.inspect}" - debug err.backtrace.join("\n") + rescue Exception => e + error "error while shutting down: #{e.pretty_inspect}" end @rawsock = nil if @ssl @sock = nil @@ -520,7 +517,7 @@ module Irc @lines_sent += 1 @burst += 1 end - rescue => e + rescue Exception => e handle_socket_error(:SEND, e) end end