Exception: Moped::Errors::MongoError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/moped/errors.rb

Overview

Generic error class for exceptions generated on the remote MongoDB server.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, details) ⇒ MongoError

Create a new operation failure exception.

Examples:

Create the new error.

MongoError.new(command, details)

Parameters:

  • command (Object)

    The command that generated the error.

  • details (Hash)

    The details about the error.

Since:

  • 1.0.0



47
48
49
50
# File 'lib/moped/errors.rb', line 47

def initialize(command, details)
  @command, @details = command, details
  super(build_message)
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



36
37
38
# File 'lib/moped/errors.rb', line 36

def command
  @command
end

#command The command that generated the error.(Thecommandthatgeneratedtheerror.) ⇒ Object (readonly)



36
# File 'lib/moped/errors.rb', line 36

attr_reader :details, :command

#detailsObject (readonly)

Returns the value of attribute details.



36
37
38
# File 'lib/moped/errors.rb', line 36

def details
  @details
end

#details The details about the error.(Thedetailsabouttheerror.) ⇒ Object (readonly)



36
# File 'lib/moped/errors.rb', line 36

attr_reader :details, :command