Class: Glia::Errors::LimitExceededError

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

Instance Attribute Summary

Attributes inherited from Error

#error_details, #message, #ref, #type

Instance Method Summary collapse

Methods inherited from Error

#to_h

Constructor Details

#initialize(resource:, max:, message: nil) ⇒ LimitExceededError

Returns a new instance of LimitExceededError.



143
144
145
146
147
148
149
150
# File 'lib/glia/errors/client_errors.rb', line 143

def initialize(resource:, max:, message: nil)
  super(
    type: LIMIT_EXCEEDED_ERROR,
    ref: "https://example.com/errors/#{LIMIT_EXCEEDED_ERROR}.html",
    message: "#{humanize(resource)} " + (message || "count must not exceed #{max}"),
    error_details: { resource: resource, max: max }
  )
end