Exception: ThreeScale::Backend::UsageValueInvalid

Inherits:
Error
  • Object
show all
Defined in:
lib/3scale/backend/errors.rb

Instance Method Summary collapse

Methods inherited from Error

#code, code, #http_code, #to_xml, underscore

Constructor Details

#initialize(metric_name, value) ⇒ UsageValueInvalid

Returns a new instance of UsageValueInvalid.



156
157
158
159
160
161
162
# File 'lib/3scale/backend/errors.rb', line 156

def initialize(metric_name, value)
  if !value.is_a?(String) || value.blank?
    super %(usage value for metric "#{metric_name}" can not be empty)
  else
    super %(usage value "#{value}" for metric "#{metric_name}" is invalid)
  end
end