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.

Direct Known Subclasses

RateLimit

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Http

Returns a new instance of Http.



43
44
45
46
47
48
49
50
51
# File 'lib/shep/exceptions.rb', line 43

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.



42
43
44
# File 'lib/shep/exceptions.rb', line 42

def response
  @response
end