Exception: Parse::Embeddings::BatchEmbedder::BatchFailed

Inherits:
Error
  • Object
show all
Defined in:
lib/parse/embeddings/batch_embedder.rb

Overview

Raised when a batch still fails after max_attempts retryable failures. Wraps the final provider error in #cause and carries the index of the failing batch so a resumable job knows where to pick up.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, batch_index:, completed_count:) ⇒ BatchFailed

Returns a new instance of BatchFailed.



54
55
56
57
58
# File 'lib/parse/embeddings/batch_embedder.rb', line 54

def initialize(message, batch_index:, completed_count:)
  @batch_index = batch_index
  @completed_count = completed_count
  super(message)
end

Instance Attribute Details

#batch_indexInteger (readonly)

Returns zero-based index of the failing batch.

Returns:

  • (Integer)

    zero-based index of the failing batch.



50
51
52
# File 'lib/parse/embeddings/batch_embedder.rb', line 50

def batch_index
  @batch_index
end

#completed_countInteger (readonly)

Returns number of inputs successfully embedded before the failure.

Returns:

  • (Integer)

    number of inputs successfully embedded before the failure.



52
53
54
# File 'lib/parse/embeddings/batch_embedder.rb', line 52

def completed_count
  @completed_count
end