Exception: AwesomeSpawn::CommandResultError
- Inherits:
-
StandardError
- Object
- StandardError
- AwesomeSpawn::CommandResultError
- Defined in:
- lib/awesome_spawn/command_result_error.rb
Instance Attribute Summary collapse
-
#result ⇒ CommandResult
readonly
The command that caused the error.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message, result) ⇒ CommandResultError
constructor
A new instance of CommandResultError.
Constructor Details
#initialize(message, result) ⇒ CommandResultError
Returns a new instance of CommandResultError.
10 11 12 13 14 |
# File 'lib/awesome_spawn/command_result_error.rb', line 10 def initialize(, result) += " error was: #{result.error}" if !result.nil? && !result.error.empty? super() @result = result end |
Instance Attribute Details
#result ⇒ CommandResult (readonly)
Returns The command that caused the error.
8 9 10 |
# File 'lib/awesome_spawn/command_result_error.rb', line 8 def result @result end |
Class Method Details
.default_message(command, exit_status) ⇒ Object
3 4 5 |
# File 'lib/awesome_spawn/command_result_error.rb', line 3 def self.(command, exit_status) "#{command} exit code: #{exit_status}" end |