Skip to content
Browse files

Where possible, don't rescue Exception

This allows single-threaded applications to set a Timeout and be
assured that no one will intercept it.
  • Loading branch information...
1 parent 3f89a8d commit 09fef22b4a84886f30c2089e20b04f3cabc3214c @gdb committed Jan 17, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/bunny/session.rb
  2. +1 −1 lib/bunny/transport.rb
View
2 lib/bunny/session.rb
@@ -263,7 +263,7 @@ def handle_frame(ch_number, method)
@event_loop = nil
@transport.close
- rescue Exception => e
+ rescue StandardError => e
puts e.class.name
puts e.message
puts e.backtrace
View
2 lib/bunny/transport.rb
@@ -175,7 +175,7 @@ def initialize_socket
@socket.post_connection_check(host) if @verify_ssl
@socket
end
- rescue Exception => e
+ rescue StandardError, ConnectionTimeout => e
@status = :not_connected
raise Bunny::TCPConnectionFailed.new(e, self.hostname, self.port)
end

0 comments on commit 09fef22

Please sign in to comment.
Something went wrong with that request. Please try again.