Exception: Agent::Lock::Error

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

Overview

The base of everything this gem raises. In a file of its own so that any part of the library can require it without reaching for the entry point, which would require the part doing the asking.

Examples:

raise Agent::Lock::Error.new("this tree's locks live in file, not redis", command: "switch-backend redis")

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, command: nil) ⇒ Error

Returns a new instance of Error.

Parameters:

  • message (String, nil) (defaults to: nil)
  • command (String, nil) (defaults to: nil) —


20
21
22
23
# File 'lib/agent/lock/error.rb', line 20

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

Instance Attribute Details

#command ⇒ String? (readonly)

The alock command that gets past this error, without the program name, which only the launcher knows: alock or agent-lock.

Returns:

  • (String, nil) —

    e.g. switch-backend redis



16
17
18
# File 'lib/agent/lock/error.rb', line 16

def command
  @command
end