Exception: Insika::ProviderError

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

Overview

ACTION classification (B9). The fields ride in the task's error record and the :task_failed event so the client envelope can tell fatal from retryable and quote the provider's own retry_after (A8). A bare ProviderError.new("boom") has an empty classification and adds nothing to the contract.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, kind: nil, retryable: nil, retry_after: nil) ⇒ ProviderError

Returns a new instance of ProviderError.



42
43
44
45
46
47
# File 'lib/insika/errors.rb', line 42

def initialize(message = nil, kind: nil, retryable: nil, retry_after: nil)
  @kind = kind
  @retryable = retryable
  @retry_after = retry_after
  super(message)
end

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind.



40
41
42
# File 'lib/insika/errors.rb', line 40

def kind
  @kind
end

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



40
41
42
# File 'lib/insika/errors.rb', line 40

def retry_after
  @retry_after
end

#retryableObject (readonly)

Returns the value of attribute retryable.



40
41
42
# File 'lib/insika/errors.rb', line 40

def retryable
  @retryable
end

Instance Method Details

#classificationObject

the additive envelope fields, compacted — nil retry_after stays absent.



50
51
52
# File 'lib/insika/errors.rb', line 50

def classification
  { kind: kind, retryable: retryable, retry_after: retry_after }.compact
end