Exception: Pione::Command::SpawnError

Inherits:
CommandException show all
Defined in:
lib/pione/command/command-exception.rb

Overview

SpawnError is raised when the command failed to run.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(caller, callee, argv, cause) ⇒ SpawnError

Returns a new instance of SpawnError.



21
22
23
24
25
26
# File 'lib/pione/command/command-exception.rb', line 21

def initialize(caller, callee, argv, cause)
  @caller = caller
  @callee = callee
  @argv = argv
  @cause = cause
end

Class Method Details

.child_process_is_dead(caller, callee, argv) ⇒ SpawnError

Create a spawn error caused that child process is dead

Parameters:

  • caller (String)

    caller name

  • callee (String)

    callee name

  • argv (Array<String>)

    arguments of process call

Returns:



17
18
19
# File 'lib/pione/command/command-exception.rb', line 17

def self.child_process_is_dead(caller, callee, argv)
  new(caller, callee, argv, "child process is dead")
end

Instance Method Details

#messageObject



28
29
30
31
# File 'lib/pione/command/command-exception.rb', line 28

def message
  args = {caller: @caller, callee: @callee, argv: @argv, cause: @cause}
  '"%{caller}" has failed to spawn "%{callee}" %{argv}: %{cause}' % args
end