lib/mongo/error/pool_closed_error.rb in mongo-2.10.5 vs lib/mongo/error/pool_closed_error.rb in mongo-2.11.0.rc0

- old
+ new

@@ -24,20 +24,27 @@ # pool's connections connect to. # # @since 2.9.0 attr_reader :address + # @return [ Mongo::Server::ConnectionPool ] pool The pool that is closed. + # + # @since 2.11.0 + # @api experimental + attr_reader :pool + # Instantiate the new exception. # # @example Instantiate the exception. - # Mongo::Error::PoolClosedError.new(address) + # Mongo::Error::PoolClosedError.new(address, pool) # # @since 2.9.0 # @api private - def initialize(address) + def initialize(address, pool) @address = address - - super("Attempted to use a connection pool which has been closed (for #{address})") + @pool = pool + super("Attempted to use a connection pool which has been closed (for #{address} " + + "with pool 0x#{pool.object_id})") end end end end