Method: ProcessExecuter::CommandError#initialize

Defined in:
lib/process_executer/errors.rb

#initialize(result) ⇒ CommandError

Create a CommandError object

Examples:

`exit 1` # set $? appropriately for this example
result = ProcessExecuter::Result.new(%w[git status], $?, 'stdout', 'stderr')
error = ProcessExecuter::CommandError.new(result)
error.to_s #=> '["git", "status"], status: pid 89784 exit 1, stderr: "stderr"'

Parameters:

  • result (Result)

    The result of the command including the command, status, stdout, and stderr



78
79
80
81
# File 'lib/process_executer/errors.rb', line 78

def initialize(result)
  @result = result
  super(error_message)
end