Exception: Cohere::Transcribe::ASR::ExecutionError
- Inherits:
-
TranscriptionRuntimeError
- Object
- StandardError
- Error
- TranscriptionError
- TranscriptionRuntimeError
- Cohere::Transcribe::ASR::ExecutionError
- Defined in:
- lib/cohere/transcribe/asr/failure_policy.rb
Overview
An inference failure whose recovery class is known at the boundary where it occurred. Native bindings can use this instead of encoding machine-readable state in an error-message string.
Direct Known Subclasses
Constant Summary collapse
- KINDS =
%i[oom fatal error].freeze
Instance Attribute Summary collapse
-
#failure_kind ⇒ Object
readonly
Returns the value of attribute failure_kind.
-
#original ⇒ Object
readonly
Returns the value of attribute original.
Instance Method Summary collapse
-
#initialize(message, failure_kind:, original: nil) ⇒ ExecutionError
constructor
A new instance of ExecutionError.
Constructor Details
#initialize(message, failure_kind:, original: nil) ⇒ ExecutionError
Returns a new instance of ExecutionError.
16 17 18 19 20 21 22 23 |
# File 'lib/cohere/transcribe/asr/failure_policy.rb', line 16 def initialize(, failure_kind:, original: nil) kind = failure_kind.to_sym raise ArgumentError, "failure_kind must be one of: #{KINDS.join(", ")}" unless KINDS.include?(kind) @failure_kind = kind @original = original super() end |
Instance Attribute Details
#failure_kind ⇒ Object (readonly)
Returns the value of attribute failure_kind.
14 15 16 |
# File 'lib/cohere/transcribe/asr/failure_policy.rb', line 14 def failure_kind @failure_kind end |
#original ⇒ Object (readonly)
Returns the value of attribute original.
14 15 16 |
# File 'lib/cohere/transcribe/asr/failure_policy.rb', line 14 def original @original end |