Method: Git::CommandLineError#initialize

Defined in:
lib/git/errors.rb

#initialize(result) ⇒ CommandLineError

Create a CommandLineError object

Examples:

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

Parameters:

  • result (Git::CommandLineResult)

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



97
98
99
100
# File 'lib/git/errors.rb', line 97

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