Exception: Harvest::HTTPError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ HTTPError

Returns a new instance of HTTPError.



6
7
8
9
# File 'lib/harvest/errors.rb', line 6

def initialize(response)
  @response = response
  super
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/harvest/errors.rb', line 5

def response
  @response
end

Instance Method Details

#to_sObject



11
12
13
14
# File 'lib/harvest/errors.rb', line 11

def to_s
  hint = response.headers["hint"].nil? ? nil : response.headers["hint"].first
  "#{self.class.to_s} : #{response.code}#{" - #{hint}" if hint}"
end