Exception: ProcessWatcher::NonzeroExitCode

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/process_watcher.rb

Overview

Raised when a subprocess completed, but with a nonzero exit code.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exit_code, output) ⇒ NonzeroExitCode

Returns a new instance of NonzeroExitCode.



50
51
52
53
# File 'lib/process_watcher.rb', line 50

def initialize(exit_code, output)
  @exit_code = exit_code
  @output = output
end

Instance Attribute Details

#exit_codeObject (readonly)

(Fixnum) exit code returned by the subprocess



46
47
48
# File 'lib/process_watcher.rb', line 46

def exit_code
  @exit_code
end

#outputObject (readonly)

(String) process output (hopefully explaining the situation)



48
49
50
# File 'lib/process_watcher.rb', line 48

def output
  @output
end

Instance Method Details

#to_sObject

Describe the error.



56
57
58
# File 'lib/process_watcher.rb', line 56

def to_s
  "Exit code nonzero: #{@exit_code}\nOutput was #{@output}"
end