Exception: MixinBot::InsufficientAppBillingError

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

Overview

Raised when app prepaid billing credit lacks headroom for a billed operation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_id:, credit:, cost:, increment:) ⇒ InsufficientAppBillingError

Returns a new instance of InsufficientAppBillingError.



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/mixin_bot/errors.rb', line 60

def initialize(app_id:, credit:, cost:, increment:)
  @app_id = app_id
  @credit = credit
  @cost = cost
  @increment = increment
  super(
    format(
      'app billing insufficient: credit %<credit>s <= cost %<cost>s + increment %<increment>s (app_id=%<app_id>s)',
      credit:, cost:, increment:, app_id:
    )
  )
end

Instance Attribute Details

#app_idObject (readonly)

Returns the value of attribute app_id.



58
59
60
# File 'lib/mixin_bot/errors.rb', line 58

def app_id
  @app_id
end

#costObject (readonly)

Returns the value of attribute cost.



58
59
60
# File 'lib/mixin_bot/errors.rb', line 58

def cost
  @cost
end

#creditObject (readonly)

Returns the value of attribute credit.



58
59
60
# File 'lib/mixin_bot/errors.rb', line 58

def credit
  @credit
end

#incrementObject (readonly)

Returns the value of attribute increment.



58
59
60
# File 'lib/mixin_bot/errors.rb', line 58

def increment
  @increment
end