Exception: Ashby::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Ashby::Error
- Defined in:
- lib/ashby/error.rb,
lib/ashby.rb
Overview
Custom error class for the Ashby module that extends StandardError with optional error code support.
This class provides a standardized way to handle errors within the Ashby module by allowing both error messages and optional error codes to be associated with exceptions.
Instance Attribute Summary collapse
-
#code ⇒ Object?
readonly
The optional error code associated with this error.
Instance Method Summary collapse
-
#initialize(message, code = nil) ⇒ Error
constructor
Initialize a new Ashby::Error instance.
Constructor Details
#initialize(message, code = nil) ⇒ Error
Initialize a new Ashby::Error instance
33 34 35 36 |
# File 'lib/ashby/error.rb', line 33 def initialize(, code = nil) super() @code = code end |
Instance Attribute Details
#code ⇒ Object? (readonly)
The optional error code associated with this error
26 27 28 |
# File 'lib/ashby/error.rb', line 26 def code @code end |