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.



148
149
150
151
152
153
# File 'lib/legion/llm/errors.rb', line 148

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.



146
147
148
# File 'lib/legion/llm/errors.rb', line 146

def got
  @got
end

#headerObject (readonly)

Returns the value of attribute header.



146
147
148
# File 'lib/legion/llm/errors.rb', line 146

def header
  @header
end

#validObject (readonly)

Returns the value of attribute valid.



146
147
148
# File 'lib/legion/llm/errors.rb', line 146

def valid
  @valid
end

Instance Method Details

#retryable?Boolean

Returns:

  • (Boolean)


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

def retryable? = false