123456789_123456789_123456789_123456789_123456789_

Exception: Mongo::Error::NoServiceConnectionAvailable

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ::Mongo::Error, StandardError
Instance Chain:
Inherits: Mongo::Error
  • Object
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.

Since:

  • 2.0.0

Constant Summary

::Mongo::Error - Inherited

BAD_VALUE, CODE, CURSOR_NOT_FOUND, ERR, ERRMSG, ERROR, TRANSIENT_TRANSACTION_ERROR_LABEL, UNKNOWN_ERROR, UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL, WRITE_CONCERN_ERROR, WRITE_CONCERN_ERRORS, WRITE_ERRORS

Class Method Summary

::Mongo::Error - Inherited

Instance Attribute Summary

::Mongo::Error - Inherited

#change_stream_resumable?

Can the change stream on which this error occurred be resumed, provided the operation that triggered this error was a getMore?

ChangeStreamResumable - Included

#change_stream_resumable?

Can the change stream on which this error occurred be resumed, provided the operation that triggered this error was a getMore?

WriteRetryable - Included

Notable - Included

#connection_global_id

Returns global id of the connection on which the error occurred.

#generation

Returns connection pool generation for the connection on which the error occurred.

#service_id

Returns service id for the connection on which the error occurred.

Instance Method Summary

::Mongo::Error - Inherited

#write_concern_error_label?

Does the write concern error have the given label?

#write_concern_error_labels

The set of error labels associated with the write concern error.

Labelable - Included

#add_label

Adds the specified label to the error instance, if the label is not already in the set of labels.

#label?

Does the error have the given label?

#labels

Gets the set of labels associated with the error.

Notable - Included

#add_note,
#add_notes

Allows multiple notes to be added in a single call, for convenience.

#notes

Returns an array of strings with additional information about the exception.

#to_s, #notes_tail

Class Method Details

.generate(address:, service_id:)

This method is for internal use only.

Since:

  • 2.0.0

[ GitHub ]

  
# File 'lib/mongo/error/no_service_connection_available.rb', line 40

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

Instance Attribute Details

#addressMongo::Address (readonly)

Returns:

  • (Mongo::Address)

    The address to which a connection was requested.

Since:

  • 2.0.0

[ GitHub ]

  
# File 'lib/mongo/error/no_service_connection_available.rb', line 34

attr_reader :address

#service_idnil | Object (readonly)

Returns:

  • (nil | Object)

    The service id.

Since:

  • 2.0.0

[ GitHub ]

  
# File 'lib/mongo/error/no_service_connection_available.rb', line 37

attr_reader :service_id