Exception: Shep::Error::Http

Inherits:
Server show all
Defined in:
lib/shep/exceptions.rb

Overview

Thrown when the HTTP library returns an error response.

Basically the same meaning as Error::Server but also includes the response object for your perusal.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Http

Returns a new instance of Http.



40
41
42
43
44
45
46
47
48
# File 'lib/shep/exceptions.rb', line 40

def initialize(response)
  msg = "HTTP Error #{response.class}"

  errmsg = find_error_msg_if_present(response)
  msg += ": #{errmsg}" if errmsg != ""

  super(msg)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



39
40
41
# File 'lib/shep/exceptions.rb', line 39

def response
  @response
end