class ARI::Error

Attributes

error_info[RW]
response_body[RW]

Public Class Methods

new(response_body = "", error_info = nil) click to toggle source
Calls superclass method
# File lib/ari/errors.rb, line 8
def initialize(response_body = "", error_info = nil)
  if response_body &&  response_body.is_a?(String)
    @response_body = response_body.strip
  else
    @response_body = ''
  end
  if error_info.nil?
    begin
      error_info = ARI::JSON.load(response_body.to_s)
    rescue
      error_info ||= {}
    end
  end
  @error_info = error_info
  message = @response_body
  super(message)
end