Exception: Bsdkrun::CommandFailed
- Defined in:
- lib/bsdkrun/errors.rb
Overview
A bsdkrun invocation exited non-zero.
Instance Attribute Summary collapse
-
#command ⇒ String
readonly
A human label for the command that failed.
-
#exit_code ⇒ Integer
readonly
The process exit status.
-
#stderr ⇒ String
readonly
The captured standard error.
-
#stdout ⇒ String
readonly
The captured standard output.
Instance Method Summary collapse
-
#initialize(exit_code:, stdout:, stderr:, command:) ⇒ CommandFailed
constructor
A new instance of CommandFailed.
Constructor Details
#initialize(exit_code:, stdout:, stderr:, command:) ⇒ CommandFailed
Returns a new instance of CommandFailed.
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/bsdkrun/errors.rb', line 33 def initialize(exit_code:, stdout:, stderr:, command:) @exit_code = exit_code @stdout = stdout @stderr = stderr @command = command = "command failed (exit #{exit_code}): #{command}" trimmed = stderr.to_s.strip += "\n#{trimmed}" unless trimmed.empty? super() end |
Instance Attribute Details
#command ⇒ String (readonly)
Returns a human label for the command that failed.
27 28 29 |
# File 'lib/bsdkrun/errors.rb', line 27 def command @command end |
#exit_code ⇒ Integer (readonly)
Returns the process exit status.
21 22 23 |
# File 'lib/bsdkrun/errors.rb', line 21 def exit_code @exit_code end |
#stderr ⇒ String (readonly)
Returns the captured standard error.
25 26 27 |
# File 'lib/bsdkrun/errors.rb', line 25 def stderr @stderr end |
#stdout ⇒ String (readonly)
Returns the captured standard output.
23 24 25 |
# File 'lib/bsdkrun/errors.rb', line 23 def stdout @stdout end |