Module: Mongo::Error::Notable Private

Included in:
Mongo::Error, AuthError
Defined in:
lib/mongo/error/notable.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

A module encapsulating note tracking functionality, since currently the driver does not have a single exception hierarchy root.

Since:

  • 2.11.0

Instance Method Summary collapse

Instance Method Details

#add_note(note) ⇒ 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.

Since:

  • 2.11.0



41
42
43
44
45
46
# File 'lib/mongo/error/notable.rb', line 41

def add_note(note)
  unless @notes
    @notes = []
  end
  @notes << note
end

#notesArray<String>

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

Returns:

  • (Array<String>)

    Additional information strings.

Since:

  • 2.11.0



32
33
34
35
36
37
38
# File 'lib/mongo/error/notable.rb', line 32

def notes
  if @notes
    @notes.dup
  else
    []
  end
end

#to_sObject

Since:

  • 2.11.0



49
50
51
# File 'lib/mongo/error/notable.rb', line 49

def to_s
  super + notes_tail
end