Exception: Shells::NonZeroExitCode

Inherits:
ShellError
  • Object
show all
Defined in:
lib/shells/errors.rb

Overview

An error raised when a command exits with a non-zero status.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exit_code) ⇒ NonZeroExitCode

Creates a new non-zero exit code error.



29
30
31
# File 'lib/shells/errors.rb', line 29

def initialize(exit_code)
  self.exit_code = exit_code
end

Instance Attribute Details

#exit_codeObject

The exit code triggering the error.



25
26
27
# File 'lib/shells/errors.rb', line 25

def exit_code
  @exit_code
end

Instance Method Details

#messageObject

:nodoc:



33
34
35
# File 'lib/shells/errors.rb', line 33

def message # :nodoc:
  "The exit code was #{exit_code}."
end