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



22
23
24
# File 'lib/rets4r/client/exceptions.rb', line 22

def initialize(http_response)
  self.http_response = http_response
end

Instance Attribute Details

#http_responseObject

Returns the value of attribute http_response.



19
20
21
# File 'lib/rets4r/client/exceptions.rb', line 19

def http_response
  @http_response
end

Instance Method Details

#codeObject

Shorthand for calling HTTPResponse#code



27
28
29
# File 'lib/rets4r/client/exceptions.rb', line 27

def code
  http_response.code
end

#messageObject

Shorthand for calling HTTPResponse#message



32
33
34
# File 'lib/rets4r/client/exceptions.rb', line 32

def message
  http_response.message
end

#rets_messageObject

Returns the RETS specification message for the HTTP response code



37
38
39
# File 'lib/rets4r/client/exceptions.rb', line 37

def rets_message
  Client::RETS_HTTP_MESSAGES[code]
end

#to_sObject



41
42
43
# File 'lib/rets4r/client/exceptions.rb', line 41

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