Exception: Pangea::Magma::Runner::SubprocessError
- Defined in:
- lib/pangea/magma/runner.rb
Overview
Inherits from Pangea::Magma::Error so callers can ‘rescue Pangea::Magma::Error` and catch any failure raised by the shared command-line plumbing.
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
-
#initialize(command:, exit_code:, stdout:, stderr:) ⇒ SubprocessError
constructor
A new instance of SubprocessError.
Constructor Details
#initialize(command:, exit_code:, stdout:, stderr:) ⇒ SubprocessError
Returns a new instance of SubprocessError.
48 49 50 51 52 53 54 55 |
# File 'lib/pangea/magma/runner.rb', line 48 def initialize(command:, exit_code:, stdout:, stderr:) @command = command @exit_code = exit_code @stdout = stdout @stderr = stderr super("#{command.first} (#{command[1..].join(' ')}) failed (exit #{exit_code}):\n" \ "#{stderr}\n#{stdout}") end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
46 47 48 |
# File 'lib/pangea/magma/runner.rb', line 46 def command @command end |
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code.
46 47 48 |
# File 'lib/pangea/magma/runner.rb', line 46 def exit_code @exit_code end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
46 47 48 |
# File 'lib/pangea/magma/runner.rb', line 46 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
46 47 48 |
# File 'lib/pangea/magma/runner.rb', line 46 def stdout @stdout end |