Exception: Epics::Error

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

Direct Known Subclasses

BusinessError, TechnicalError

Defined Under Namespace

Classes: BusinessError, TechnicalError

Instance Method Summary collapse

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_sObject



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