Exception: Cohere::Transcribe::BatchTranscriptionError

Inherits:
TranscriptionError show all
Defined in:
lib/cohere/transcribe/errors.rb,
sig/cohere/transcribe.rbs

Overview

Aggregate failure that retains every completed per-file result.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(run) ⇒ BatchTranscriptionError

Returns a new instance of BatchTranscriptionError.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/cohere/transcribe/errors.rb', line 41

def initialize(run)
  @run = run
  failed_count = run.failed.length
  run_error_count = run.errors.length
  message = if failed_count.positive? && run_error_count.positive?
              "#{failed_count} transcription file(s) failed; " \
                "run errors: #{run_error_count}"
            elsif failed_count.positive?
              "#{failed_count} transcription file(s) failed"
            else
              "Transcription run failed with #{run_error_count} run error(s)"
            end
  super(message)
end

Instance Attribute Details

#runTranscriptionRun (readonly)

Returns the value of attribute run.

Returns:



39
40
41
# File 'lib/cohere/transcribe/errors.rb', line 39

def run
  @run
end