Exception: RETS4R::Client::HTTPError

Inherits:
ClientException show all
Defined in:
lib/rets4r/client/exceptions.rb

Overview

The HTTP response returned by the server indicates that there was an error processing the request and the client cannot continue on its own without intervention.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_response) ⇒ HTTPError

Takes a HTTPResponse object



55
56
57
# File 'lib/rets4r/client/exceptions.rb', line 55

def initialize(http_response)
  self.http_response = http_response
end

Instance Attribute Details

#http_responseObject

Returns the value of attribute http_response.



52
53
54
# File 'lib/rets4r/client/exceptions.rb', line 52

def http_response
  @http_response
end

Instance Method Details

#codeObject

Shorthand for calling HTTPResponse#code



60
61
62
# File 'lib/rets4r/client/exceptions.rb', line 60

def code
  http_response.code
end

#messageObject

Shorthand for calling HTTPResponse#message



65
66
67
# File 'lib/rets4r/client/exceptions.rb', line 65

def message
  http_response.message
end

#rets_messageObject

Returns the RETS specification message for the HTTP response code



70
71
72
# File 'lib/rets4r/client/exceptions.rb', line 70

def rets_message
  Client::RETS_HTTP_MESSAGES[code]
end

#to_sObject



74
75
76
# File 'lib/rets4r/client/exceptions.rb', line 74

def to_s
  "#{code} #{message}: #{rets_message}"
end