Exception: ForemanMaintain::Error::ExecutionError
- Inherits:
-
StandardError
- Object
- StandardError
- ForemanMaintain::Error::ExecutionError
- Defined in:
- lib/foreman_maintain/error.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#exit_status ⇒ Object
readonly
Returns the value of attribute exit_status.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #generate_message ⇒ Object
-
#initialize(command, exit_status, input, output) ⇒ ExecutionError
constructor
A new instance of ExecutionError.
Constructor Details
#initialize(command, exit_status, input, output) ⇒ ExecutionError
Returns a new instance of ExecutionError.
28 29 30 31 32 33 34 |
# File 'lib/foreman_maintain/error.rb', line 28 def initialize(command, exit_status, input, output) @command = command @exit_status = exit_status @input = input @output = output super() end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
26 27 28 |
# File 'lib/foreman_maintain/error.rb', line 26 def command @command end |
#exit_status ⇒ Object (readonly)
Returns the value of attribute exit_status.
26 27 28 |
# File 'lib/foreman_maintain/error.rb', line 26 def exit_status @exit_status end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
26 27 28 |
# File 'lib/foreman_maintain/error.rb', line 26 def input @input end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
26 27 28 |
# File 'lib/foreman_maintain/error.rb', line 26 def output @output end |
Instance Method Details
#generate_message ⇒ Object
36 37 38 39 40 41 |
# File 'lib/foreman_maintain/error.rb', line 36 def ret = "Failed executing #{command}, exit status #{exit_status}" ret << "with input '#{input}'" if input ret << ":\n #{output}" if output && !output.empty? ret end |