Exception: Cohere::Transcribe::BatchTranscriptionError
- Inherits:
-
TranscriptionError
- Object
- StandardError
- Error
- TranscriptionError
- Cohere::Transcribe::BatchTranscriptionError
- 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
-
#run ⇒ TranscriptionRun
readonly
Returns the value of attribute run.
Instance Method Summary collapse
-
#initialize(run) ⇒ BatchTranscriptionError
constructor
A new instance of BatchTranscriptionError.
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 = 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() end |
Instance Attribute Details
#run ⇒ TranscriptionRun (readonly)
Returns the value of attribute run.
39 40 41 |
# File 'lib/cohere/transcribe/errors.rb', line 39 def run @run end |