Exception: ProcessExecuter::CommandError
- Defined in:
- lib/process_executer/errors.rb
Overview
Raised when a command fails or exits because of an uncaught signal
The command executed and its result are available from this object.
This gem will raise a more specific error for each type of failure:
- FailedError: when the command exits with a non-zero status
- SignaledError: when the command exits because of an uncaught signal
- TimeoutError: when the command times out
Direct Known Subclasses
Instance Attribute Summary collapse
-
#result ⇒ ProcessExecuter::Result
readonly
The result of the command including the command, its status and its output.
Instance Method Summary collapse
-
#error_message ⇒ String
The human readable representation of this error.
-
#initialize(result) ⇒ CommandError
constructor
Create a CommandError object.
Constructor Details
#initialize(result) ⇒ CommandError
Create a CommandError object
102 103 104 105 |
# File 'lib/process_executer/errors.rb', line 102 def initialize(result) @result = result super() end |
Instance Attribute Details
#result ⇒ ProcessExecuter::Result (readonly)
The result of the command including the command, its status and its output
127 128 129 |
# File 'lib/process_executer/errors.rb', line 127 def result @result end |
Instance Method Details
#error_message ⇒ String
The human readable representation of this error
114 115 116 |
# File 'lib/process_executer/errors.rb', line 114 def "#{result.command}, status: #{result}" end |