Exception: Almodovar::HttpError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/almodovar/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, url, query_params = {}) ⇒ HttpError

Children of this class must not override the initialize method



6
7
8
9
10
11
12
13
14
# File 'lib/almodovar/errors.rb', line 6

def initialize(response, url, query_params = {})
  @response_status = response.status
  @response_body = response.body
  @response_headers = response.headers
  @response_url = url
  message = "Status code #{response.status} on resource #{url}"
  message += " with params: #{query_params.inspect}" if query_params.present?
  super(message)
end

Instance Attribute Details

#response_bodyObject (readonly)

Returns the value of attribute response_body.



3
4
5
# File 'lib/almodovar/errors.rb', line 3

def response_body
  @response_body
end

#response_headersObject (readonly)

Returns the value of attribute response_headers.



3
4
5
# File 'lib/almodovar/errors.rb', line 3

def response_headers
  @response_headers
end

#response_statusObject (readonly)

Returns the value of attribute response_status.



3
4
5
# File 'lib/almodovar/errors.rb', line 3

def response_status
  @response_status
end

#response_urlObject (readonly)

Returns the value of attribute response_url.



3
4
5
# File 'lib/almodovar/errors.rb', line 3

def response_url
  @response_url
end