Exception: DiscordStore::IndexNotReadyError

Inherits:
Error
  • Object
show all
Defined in:
lib/discord_store/errors.rb

Overview

Discord's message index had not caught up with the messages being searched for, and did not catch up within the allowed number of retries.

This is not a failure so much as a statement about what search is: an index maintained asynchronously beside the messages, not the messages themselves. A write is durable the moment create_message returns; it is findable some time after that, and Discord does not promise when.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, documents_indexed: nil) ⇒ IndexNotReadyError

Returns a new instance of IndexNotReadyError.



103
104
105
106
# File 'lib/discord_store/errors.rb', line 103

def initialize(message = nil, documents_indexed: nil)
  @documents_indexed = documents_indexed
  super(message || "Discord's search index is not ready for this guild yet")
end

Instance Attribute Details

#documents_indexed ⇒ Object (readonly)

Returns the value of attribute documents_indexed.



101
102
103
# File 'lib/discord_store/errors.rb', line 101

def documents_indexed
  @documents_indexed
end