Exception: RubyGit::CommandLineError
- Defined in:
- lib/ruby_git/errors.rb
Overview
Raised when a git command fails or exits because of an uncaught signal
The git command executed, status, stdout, and stderr are available from this object.
The Gem will raise a more specific error for each type of failure:
- FailedError: when the git command exits with a non-zero status
- SignaledError: when the git command exits because of an uncaught signal
- TimeoutError: when the git command times out
Direct Known Subclasses
Instance Attribute Summary collapse
-
#result ⇒ RubyGit::CommandLineResult
readonly
The the git command result with the command and its status and output.
Instance Method Summary collapse
-
#error_message ⇒ String
The human readable representation of this error.
-
#initialize(result) ⇒ CommandLineError
constructor
Create a CommandLineError object.
Constructor Details
#initialize(result) ⇒ CommandLineError
Create a CommandLineError object
94 95 96 97 |
# File 'lib/ruby_git/errors.rb', line 94 def initialize(result) @result = result super() end |
Instance Attribute Details
#result ⇒ RubyGit::CommandLineResult (readonly)
The the git command result with the command and its status and output
119 120 121 |
# File 'lib/ruby_git/errors.rb', line 119 def result @result end |
Instance Method Details
#error_message ⇒ String
The human readable representation of this error
106 107 108 |
# File 'lib/ruby_git/errors.rb', line 106 def = "\#{result.command}, status: \#{result}, stderr: \#{result.stderr.inspect}\n".chomp |