Exception: Epics::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Epics::Error
- Defined in:
- lib/epics/error.rb
Direct Known Subclasses
Defined Under Namespace
Classes: BusinessError, TechnicalError
Instance Method Summary collapse
-
#initialize(code) ⇒ Error
constructor
A new instance of Error.
- #to_s ⇒ Object
Constructor Details
#initialize(code) ⇒ Error
Returns a new instance of Error.
6 7 8 9 |
# File 'lib/epics/error.rb', line 6 def initialize(code) @code = code @error = self.class::ERRORS.fetch(code, {}) end |
Instance Method Details
#to_s ⇒ Object
2 3 4 |
# File 'lib/epics/error.rb', line 2 def to_s [@error.fetch("symbol", "EPICS_UNKNOWN"), @error.fetch("short_text", "unknown")].join(" - ") end |