Exception: Pocketknife::Error::NodeError::ExecutionError
- Inherits:
-
Pocketknife::Error::NodeError
- Object
- StandardError
- Pocketknife::Error
- Pocketknife::Error::NodeError
- Pocketknife::Error::NodeError::ExecutionError
- Defined in:
- lib/pocketknife/errors.rb
Overview
ExecutionError
Exception raised when something goes wrong executing commands against remote host.
Instance Attribute Summary collapse
-
#cause ⇒ Rye::Err
Cause of exception, a Rye:Err.
-
#command ⇒ String
Command that failed.
-
#immediate ⇒ Boolean
Was execution’s output shown immediately? If so, don’t include output in message.
Attributes inherited from Pocketknife::Error::NodeError
Instance Method Summary collapse
-
#exit_status ⇒ Integer
Returns exit status.
-
#initialize(node, command, cause, immediate) ⇒ ExecutionError
constructor
Instantiates a new exception.
Constructor Details
#initialize(node, command, cause, immediate) ⇒ ExecutionError
Instantiates a new exception.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/pocketknife/errors.rb', line 83 def initialize(node, command, cause, immediate) self.command = command self.cause = cause self.immediate = immediate = <<-HERE.chomp Failed while executing commands on node '#{node}' - COMMAND: #{command} - EXIT STATUS: #{cause.exit_status} HERE unless immediate << <<-HERE.chomp - STDOUT: #{cause.stdout.to_s.strip} - STDERR: #{cause.stderr.to_s.strip} HERE end super(, node) end |
Instance Attribute Details
#cause ⇒ Rye::Err
Returns Cause of exception, a Rye:Err.
72 73 74 |
# File 'lib/pocketknife/errors.rb', line 72 def cause @cause end |
#command ⇒ String
Returns Command that failed.
69 70 71 |
# File 'lib/pocketknife/errors.rb', line 69 def command @command end |
#immediate ⇒ Boolean
Returns Was execution’s output shown immediately? If so, don’t include output in message.
75 76 77 |
# File 'lib/pocketknife/errors.rb', line 75 def immediate @immediate end |
Instance Method Details
#exit_status ⇒ Integer
Returns exit status.
108 109 110 |
# File 'lib/pocketknife/errors.rb', line 108 def exit_status return self.cause.exit_status end |