Exception: Xeno::BudgetExceeded

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

Overview

A session token budget is spent: raised BEFORE the model call that would overspend. Deterministic turn failure; reset recovers the session.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(axis:, used:, limit:) ⇒ BudgetExceeded

Returns a new instance of BudgetExceeded.



27
28
29
30
31
32
# File 'lib/xeno/errors.rb', line 27

def initialize(axis:, used:, limit:)
  @axis = axis
  @used = used
  @limit = limit
  super("session #{axis} token budget exceeded (#{used}/#{limit})")
end

Instance Attribute Details

#axisObject (readonly)

Returns the value of attribute axis.



25
26
27
# File 'lib/xeno/errors.rb', line 25

def axis
  @axis
end

#limitObject (readonly)

Returns the value of attribute limit.



25
26
27
# File 'lib/xeno/errors.rb', line 25

def limit
  @limit
end

#usedObject (readonly)

Returns the value of attribute used.



25
26
27
# File 'lib/xeno/errors.rb', line 25

def used
  @used
end