Class: Glia::Errors::ResourceLockedError
- 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:, locked_by: nil, message: nil) ⇒ ResourceLockedError
constructor
A new instance of ResourceLockedError.
Methods inherited from Error
Constructor Details
#initialize(resource:, locked_by: nil, message: nil) ⇒ ResourceLockedError
Returns a new instance of ResourceLockedError.
211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/glia/errors/client_errors.rb', line 211 def initialize(resource:, locked_by: nil, message: nil) Naming.assert_snake_case(resource) is_locked_by = locked_by.nil? ? '' : "Locked by: #{locked_by}" super( type: RESOURCE_LOCKED, ref: create_ref(RESOURCE_LOCKED), message: || "#{Naming.humanize(resource)} is locked. #{is_locked_by}", error_details: { resource: resource, locked_by: locked_by } ) end |