Exception: Tomo::SSH::ScriptError
- Defined in:
- lib/tomo/ssh/script_error.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
Returns the value of attribute result.
-
#script ⇒ Object
Returns the value of attribute script.
-
#ssh_args ⇒ Object
Returns the value of attribute ssh_args.
Attributes inherited from Error
Instance Method Summary collapse
Methods inherited from Error
Methods included from Colors
Instance Attribute Details
#result ⇒ Object
Returns the value of attribute result.
8 9 10 |
# File 'lib/tomo/ssh/script_error.rb', line 8 def result @result end |
#script ⇒ Object
Returns the value of attribute script.
8 9 10 |
# File 'lib/tomo/ssh/script_error.rb', line 8 def script @script end |
#ssh_args ⇒ Object
Returns the value of attribute ssh_args.
8 9 10 |
# File 'lib/tomo/ssh/script_error.rb', line 8 def ssh_args @ssh_args end |
Instance Method Details
#to_console ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/tomo/ssh/script_error.rb', line 10 def to_console msg = <<~ERROR The following script failed on #{yellow(host)} (exit status #{red(result.exit_status)}). #{yellow(script)} You can manually re-execute the script via SSH as follows: #{gray(ssh_args.map(&:shellescape).join(' '))} ERROR [msg, super].join("\n") end |