Exception: OpenAgent::SIFCodeError

Inherits:
ResponseError show all
Defined in:
lib/openagent/errors.rb

Constant Summary collapse

CODES =
{
  0 => "Success. SIF_Status/SIF_Data may contain additional data.",
  7 => "Already have a message with this SIF_MsgId from you.",
  8 => "Receiver is sleeping.",
  9 => "No messages available. This is returned when an agent is trying to pull messages from a ZIS and there are no messages available."
}

Instance Attribute Summary

Attributes inherited from ResponseError

#error_object

Instance Method Summary collapse

Constructor Details

#initialize(status_code) ⇒ SIFCodeError

Returns a new instance of SIFCodeError.



24
25
26
27
28
# File 'lib/openagent/errors.rb', line 24

def initialize(status_code)
  code = CODES[status_code]
  raise "Unknown SIF_Status Code: #{status_code.inspect} (Known Codes: #{CODES.keys.inspect})" if code.nil?
  super("Code #{status_code}: " + code)
end