Exception: BusinessFlow::ClusterLock::ClassMethods::LockFailure

Inherits:
StandardError
  • Object
show all
Defined in:
lib/business_flow/cluster_lock.rb

Overview

Error raised when there is an internal issue with acquiring a lock.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_type, message) ⇒ LockFailure

Returns a new instance of LockFailure.



56
57
58
59
# File 'lib/business_flow/cluster_lock.rb', line 56

def initialize(error_type, message)
  @error_type = error_type
  super(message)
end

Instance Attribute Details

#error_typeObject (readonly)

Returns the value of attribute error_type.



55
56
57
# File 'lib/business_flow/cluster_lock.rb', line 55

def error_type
  @error_type
end

Instance Method Details

#add_to(flow) ⇒ Object



61
62
63
64
65
# File 'lib/business_flow/cluster_lock.rb', line 61

def add_to(flow)
  errors = flow.errors
  errors.add(:cluster_lock, error_type, message: message) if !errors.key?(:cluster_lock)
  flow
end