Notable — Documentation by YARD 0.9.37 (original) (raw)

Module: Mongo::Error::NotablePrivate

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 functionality to manage data attached to exceptions in the driver, since the driver does not currently have a single exception hierarchy root.

Instance Attribute Summary collapse

Instance Method Summarycollapse

Instance Attribute Details

#connection_global_id ⇒ Integer | nil

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 global id of the connection on which the error occurred.

85 86 87 # File 'lib/mongo/error/notable.rb', line 85 def connection_global_id @connection_global_id end

#generation ⇒ Integer | nil

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 connection pool generation for the connection on which the error occurred.

71 72 73 # File 'lib/mongo/error/notable.rb', line 71 def generation @generation end

#service_id ⇒ Object | nil

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

78 79 80 # File 'lib/mongo/error/notable.rb', line 78 def service_id @service_id end

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.

45 46 47 48 49 50 51 52 53 54 55 56 57 58 # File 'lib/mongo/error/notable.rb', line 45 def add_note(note) unless @notes @notes = [] end if Lint.enabled? if @notes.include?(note) raise Error::LintError, "Adding a note which already exists in exception #{self}: #{note}" end end @notes << note end

#add_notes(*notes) ⇒ 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.

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

| 63 64 65 | # File 'lib/mongo/error/notable.rb', line 63 def add_notes(*notes) notes.each { |note| add_note(note) } end | | -------- | ------------------------------------------------------------------------------------------------------------------ |

#notes ⇒ Array

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

36 37 38 39 40 41 42 # File 'lib/mongo/error/notable.rb', line 36 def notes if @notes @notes.dup else [] end end

#to_s ⇒ Object

88 89 90 # File 'lib/mongo/error/notable.rb', line 88 def to_s super + notes_tail end