Exception: ShellWhisperer::CommandFailed
- Inherits:
-
StandardError
- Object
- StandardError
- ShellWhisperer::CommandFailed
- Defined in:
- lib/shell_whisperer.rb
Instance Attribute Summary collapse
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
-
#original_command ⇒ Object
readonly
Returns the value of attribute original_command.
-
#original_message ⇒ Object
readonly
Returns the value of attribute original_message.
Instance Method Summary collapse
-
#initialize(cmd, result, exit_code) ⇒ CommandFailed
constructor
A new instance of CommandFailed.
Constructor Details
#initialize(cmd, result, exit_code) ⇒ CommandFailed
Returns a new instance of CommandFailed.
8 9 10 11 12 13 14 15 |
# File 'lib/shell_whisperer.rb', line 8 def initialize(cmd, result, exit_code) @original_command = cmd @original_message = result @exit_code = exit_code super "Attempted to run #{cmd.inspect} but the shell reported error: " \ "#{result.chomp.inspect} and exited with exit code #{exit_code}." end |
Instance Attribute Details
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code.
6 7 8 |
# File 'lib/shell_whisperer.rb', line 6 def exit_code @exit_code end |
#original_command ⇒ Object (readonly)
Returns the value of attribute original_command.
6 7 8 |
# File 'lib/shell_whisperer.rb', line 6 def original_command @original_command end |
#original_message ⇒ Object (readonly)
Returns the value of attribute original_message.
6 7 8 |
# File 'lib/shell_whisperer.rb', line 6 def @original_message end |