Exception: BusinessFlow::ClusterLock::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.



10
11
12
13
# File 'lib/business_flow/cluster_lock.rb', line 10

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.



8
9
10
# File 'lib/business_flow/cluster_lock.rb', line 8

def error_type
  @error_type
end

Instance Method Details

#add_to(flow) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/business_flow/cluster_lock.rb', line 15

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