Refactor errors that are raised by this gem #709
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor the errors raised by this gem into this hierarchy of classes defined in the
Git
module:Other standard errors may also be raised like
ArgumentError
. Each method should document the errors it may raise.Description of each Error class:
Error
: This catch-all error serves as the base class for other custom errors in thisgem. This gem only raises errors that are a subclass of
Git::Error
.CommandLineError
: This error is raised when there's a problem executing the gitcommand line. This gem will raise a more specific error depending on how the
command line failed.
FailedError
: This error is raised when the git command line exits with a non-zerostatus code that is not expected by the git gem.
SignaledError
: This error is raised when the git command line is terminated as aresult of receiving a signal. This could happen if the process is forcibly
terminated or if there is a serious system error.
TimeoutError
: This is a specific type ofSignaledError
that is raised when thegit command line operation times out and is killed via the SIGKILL signal. This
happens if the operation takes longer than the timeout duration configured in
Git.config.timeout
or via the:timeout
parameter given in git methods thatsupport this parameter.
ProcessIOError
: An error was encountered reading or writing to a subprocess.UnexpectedResultError
: The command line ran without error but did not returnthe expected results.
For backward compatability,
Git::GitExecuteError
remains as an alias forGit::Error
. It is considereddeprecated as of v2.0.0 and will be remove in v3.0.0.