Exception: Methadone::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/methadone/error.rb

Overview

Standard exception you can throw to exit with a given status code. Generally, you should prefer Methadone::Main#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.

Direct Known Subclasses

FailedCommandError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exit_code, message = nil) ⇒ Error

Create an Error with the given status code and message



9
10
11
12
# File 'lib/methadone/error.rb', line 9

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.



7
8
9
# File 'lib/methadone/error.rb', line 7

def exit_code
  @exit_code
end