Class: Mongo::Error::NoServiceConnectionAvailable
- Inherits:
-
Error
- Object
- Error
- Mongo::Error::NoServiceConnectionAvailable
- Defined in:
- lib/mongo/error/no_service_connection_available.rb
Overview
Raised when the driver requires a connection to a particular service but no matching connections exist in the connection pool.
Instance Attribute Summary collapse
-
#address ⇒ Mongo::Address
readonly
The address to which a connection was requested.
-
#service_id ⇒ nil | Object
readonly
The service id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message, address:, service_id:) ⇒ NoServiceConnectionAvailable
constructor
private
A new instance of NoServiceConnectionAvailable.
Constructor Details
#initialize(message, address:, service_id:) ⇒ NoServiceConnectionAvailable
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of NoServiceConnectionAvailable.
23 24 25 26 27 28 |
# File 'lib/mongo/error/no_service_connection_available.rb', line 23 def initialize(, address:, service_id:) super() @address = address @service_id = service_id end |
Instance Attribute Details
#address ⇒ Mongo::Address (readonly)
Returns The address to which a connection was requested.
32 33 34 |
# File 'lib/mongo/error/no_service_connection_available.rb', line 32 def address @address end |
#service_id ⇒ nil | Object (readonly)
Returns The service id.
35 36 37 |
# File 'lib/mongo/error/no_service_connection_available.rb', line 35 def service_id @service_id end |
Class Method Details
.generate(address:, service_id:) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 41 42 43 44 |
# File 'lib/mongo/error/no_service_connection_available.rb', line 38 def self.generate(address:, service_id:) new( "The connection pool for #{address} does not have a connection for service #{service_id}", address: address, service_id: service_id ) end |