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.



58
59
60
61
# File 'lib/business_flow/cluster_lock.rb', line 58

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.



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

def error_type
  @error_type
end

Instance Method Details

#add_to(flow) ⇒ Object



63
64
65
66
67
68
69
# File 'lib/business_flow/cluster_lock.rb', line 63

def add_to(flow)
  errors = flow.errors
  unless errors.key?(:cluster_lock)
    BusinessFlow.add_error(errors, :cluster_lock, error_type, message)
  end
  flow
end