Exception: Agent::Lock::Refused

Inherits:
Error
  • Object
show all
Defined in:
lib/agent/lock/error.rb

Overview

A lock operation the CLI would have explained on stderr and refused.

The message is that text. result is the Manager::Result or Skill::Result behind it, so the records are available without parsing the message.

Examples:

begin
  facade.acquire("lib/**")
rescue Agent::Lock::Refused => e
  e.result.record.agent_id
end

Instance Attribute Summary collapse

Attributes inherited from Error

#command

Instance Method Summary collapse

Constructor Details

#initialize(message, result: nil) ⇒ Refused

Returns a new instance of Refused.

Parameters:



44
45
46
47
# File 'lib/agent/lock/error.rb', line 44

def initialize(message, result: nil)
  super(message)
  @result = result
end

Instance Attribute Details

#result ⇒ Manager::Result, ... (readonly)

Returns the operation that was refused.

Returns:



40
41
42
# File 'lib/agent/lock/error.rb', line 40

def result
  @result
end