Exception: OpenReceive::Server::Swap::WeightBudgetError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/openreceive/server/swap/weight_budget.rb

Overview

Raised when a reservation would exceed the process-local weight budget. Marked (weight_budget?) so quote classification can map it to provider_rate_limited, mirroring the JS weightBudget error tag.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, denial = {}) ⇒ WeightBudgetError

Returns a new instance of WeightBudgetError.



16
17
18
19
# File 'lib/openreceive/server/swap/weight_budget.rb', line 16

def initialize(message, denial = {})
  super(message)
  @denial = denial
end

Instance Attribute Details

#denialObject (readonly)

The denial diagnostics (provider, path, reason, used/cost/gate, window start, backoff) ride the error itself.



14
15
16
# File 'lib/openreceive/server/swap/weight_budget.rb', line 14

def denial
  @denial
end

Instance Method Details

#weight_budget?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/openreceive/server/swap/weight_budget.rb', line 21

def weight_budget?
  true
end