Exception: Methadone::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Methadone::Error
- 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
Instance Attribute Summary collapse
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
Instance Method Summary collapse
-
#initialize(exit_code, message = nil) ⇒ Error
constructor
Create an Error with the given status code and message.
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,=nil) super() @exit_code = exit_code end |
Instance Attribute Details
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code.
7 8 9 |
# File 'lib/methadone/error.rb', line 7 def exit_code @exit_code end |