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.



44
45
46
# File 'lib/shells/errors.rb', line 44

def initialize(exit_code)
  self.exit_code = exit_code
end

Instance Attribute Details

#exit_codeObject

The exit code triggering the error.



40
41
42
# File 'lib/shells/errors.rb', line 40

def exit_code
  @exit_code
end

Instance Method Details

#messageObject

:nodoc:



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

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