Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ruby-amqp/bunny
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Klishin committed Jan 18, 2013
2 parents 9d4cce0 + be122a2 commit ad6ab46
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions lib/bunny/exceptions.rb
Expand Up @@ -136,4 +136,13 @@ class InvalidCommand < ConnectionLevelException

class UnexpectedFrame < ConnectionLevelException
end

class NetworkErrorWrapper < StandardError
attr_reader :other

def initialize(other)
super(other.message)
@other = other
end
end
end
4 changes: 3 additions & 1 deletion lib/bunny/session.rb
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 Expand Up @@ -309,6 +309,8 @@ def handle_frameset(ch_number, frames)
end

def handle_network_failure(exception)
raise NetworkErrorWrapper.new(exception) unless @threaded

if !recovering_from_network_failure?
@recovering_from_network_failure = true
if recoverable_network_failure?(exception)
Expand Down
2 changes: 1 addition & 1 deletion lib/bunny/transport.rb
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 ad6ab46

Please sign in to comment.