Class: Glia::Errors::ResourceAlreadyExistsError
- Defined in:
- lib/glia/errors/client_errors.rb
Instance Attribute Summary
Attributes inherited from Error
#error_details, #message, #ref, #type
Instance Method Summary collapse
-
#initialize(resource:, message: nil) ⇒ ResourceAlreadyExistsError
constructor
A new instance of ResourceAlreadyExistsError.
Methods inherited from Error
Constructor Details
#initialize(resource:, message: nil) ⇒ ResourceAlreadyExistsError
Returns a new instance of ResourceAlreadyExistsError.
211 212 213 214 215 216 217 218 219 220 |
# File 'lib/glia/errors/client_errors.rb', line 211 def initialize(resource:, message: nil) Naming.assert_snake_case(resource) super( type: RESOURCE_ALREADY_EXISTS_ERROR, ref: create_ref(RESOURCE_ALREADY_EXISTS_ERROR), message: || "#{Naming.humanize(resource)} already exists", error_details: { resource: resource } ) end |