Class: Glia::Errors::InvalidResourceStateError
- 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:, state:, message: nil) ⇒ InvalidResourceStateError
constructor
A new instance of InvalidResourceStateError.
Methods inherited from Error
Constructor Details
#initialize(resource:, state:, message: nil) ⇒ InvalidResourceStateError
Returns a new instance of InvalidResourceStateError.
228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/glia/errors/client_errors.rb', line 228 def initialize(resource:, state:, message: nil) Naming.assert_snake_case(resource) Naming.assert_snake_case(state) super( type: INVALID_RESOURCE_STATE_ERROR, ref: create_ref(INVALID_RESOURCE_STATE_ERROR), message: || "#{Naming.humanize(resource)} is in invalid state: #{state}", error_details: { resource: resource, state: state } ) end |