Exception: Grit::Git::CommandFailed

Inherits:
StandardError
  • Object
show all
Defined in:
lib/grit/git.rb

Overview

Raised when a native git command exits with non-zero.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, exitstatus, err = '') ⇒ CommandFailed

Returns a new instance of CommandFailed.


26
27
28
29
30
31
# File 'lib/grit/git.rb', line 26

def initialize(command, exitstatus, err='')
  @command = command
  @exitstatus = exitstatus
  @err = err
  super "Command exited with #{exitstatus}: #{command}"
end

Instance Attribute Details

#commandObject (readonly)

The full git command that failed as a String.


18
19
20
# File 'lib/grit/git.rb', line 18

def command
  @command
end

#errObject (readonly)

Everything output on the command's stderr as a String.


24
25
26
# File 'lib/grit/git.rb', line 24

def err
  @err
end

#exitstatusObject (readonly)

The integer exit status.


21
22
23
# File 'lib/grit/git.rb', line 21

def exitstatus
  @exitstatus
end