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.



48
49
50
51
# File 'lib/business_flow/cluster_lock.rb', line 48

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.



47
48
49
# File 'lib/business_flow/cluster_lock.rb', line 47

def error_type
  @error_type
end

Instance Method Details

#add_to(flow) ⇒ Object



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

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