Skip to content

Commit

Permalink
Where possible, don't rescue Exception
Browse files Browse the repository at this point in the history
This allows single-threaded applications to set a Timeout and be
assured that no one will intercept it.
  • Loading branch information
gdb committed Jan 18, 2013
1 parent 3f89a8d commit 09fef22
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/bunny/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/bunny/transport.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 09fef22

Please sign in to comment.