Exception: Legion::LLM::Errors::InvalidHeader

Inherits:
LLMError
  • Object
show all
Defined in:
lib/legion/llm/errors.rb

Overview

An x-legion-* header carried an unrecognized value (e.g. invalid tier name). Raised by PayloadBuilder at ingress per G31. HTTP 400.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(header:, got:, valid: [], message: nil) ⇒ InvalidHeader

Returns a new instance of InvalidHeader.



183
184
185
186
187
188
# File 'lib/legion/llm/errors.rb', line 183

def initialize(header:, got:, valid: [], message: nil, **)
  @header = header
  @got    = got
  @valid  = valid
  super(message || "invalid value #{got.inspect} for header #{header.inspect}; valid: #{valid.inspect}")
end

Instance Attribute Details

#gotObject (readonly)

Returns the value of attribute got.



181
182
183
# File 'lib/legion/llm/errors.rb', line 181

def got
  @got
end

#headerObject (readonly)

Returns the value of attribute header.



181
182
183
# File 'lib/legion/llm/errors.rb', line 181

def header
  @header
end

#validObject (readonly)

Returns the value of attribute valid.



181
182
183
# File 'lib/legion/llm/errors.rb', line 181

def valid
  @valid
end

Instance Method Details

#retryable?Boolean

Returns:

  • (Boolean)


190
# File 'lib/legion/llm/errors.rb', line 190

def retryable? = false