Exception: Pangea::Magma::Runner::SubprocessError

Inherits:
Error
  • Object
show all
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

Instance Method Summary collapse

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

#commandObject (readonly)

Returns the value of attribute command.



46
47
48
# File 'lib/pangea/magma/runner.rb', line 46

def command
  @command
end

#exit_codeObject (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

#stderrObject (readonly)

Returns the value of attribute stderr.



46
47
48
# File 'lib/pangea/magma/runner.rb', line 46

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



46
47
48
# File 'lib/pangea/magma/runner.rb', line 46

def stdout
  @stdout
end