Exception: Melaya::TierInsufficientError

Inherits:
MelayaError
  • Object
show all
Defined in:
lib/melaya/errors.rb

Overview

Raised when the server returns { error: 'tier_insufficient' } (HTTP 403). Check #tier for the minimum required tier string.

Instance Attribute Summary collapse

Attributes inherited from MelayaError

#body, #code, #status

Instance Method Summary collapse

Constructor Details

#initialize(tier: nil, body: nil) ⇒ TierInsufficientError

Returns a new instance of TierInsufficientError.



31
32
33
34
# File 'lib/melaya/errors.rb', line 31

def initialize(tier: nil, body: nil)
  @tier = tier
  super("Melaya: feature requires a higher tier (#{tier})", status: 403, code: "tier_insufficient", body: body)
end

Instance Attribute Details

#tierObject (readonly)

Returns the value of attribute tier.



29
30
31
# File 'lib/melaya/errors.rb', line 29

def tier
  @tier
end