Exception: ShellHelpers::ExitError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/shell_helpers/sh.rb

Overview

ExitNow {{{ Standard exception you can throw to exit with a given status code. Generally, you should prefer SH::ExitNow.exit_now! over using this directly, however you may wish to create a rich hierarchy of exceptions that extend from this in your app, so this is provided if you wish to do so.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exit_code, message = nil) ⇒ ExitError

Create an Error with the given status code and message



29
30
31
32
# File 'lib/shell_helpers/sh.rb', line 29

def initialize(exit_code,message=nil)
  super(message)
  @exit_code = exit_code
end

Instance Attribute Details

#exit_codeObject (readonly)

Returns the value of attribute exit_code.



27
28
29
# File 'lib/shell_helpers/sh.rb', line 27

def exit_code
  @exit_code
end