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.



222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/mixin_bot/errors.rb', line 222

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.



220
221
222
# File 'lib/mixin_bot/errors.rb', line 220

def app_id
  @app_id
end

#costObject (readonly)

Returns the value of attribute cost.



220
221
222
# File 'lib/mixin_bot/errors.rb', line 220

def cost
  @cost
end

#creditObject (readonly)

Returns the value of attribute credit.



220
221
222
# File 'lib/mixin_bot/errors.rb', line 220

def credit
  @credit
end

#incrementObject (readonly)

Returns the value of attribute increment.



220
221
222
# File 'lib/mixin_bot/errors.rb', line 220

def increment
  @increment
end