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, params = {}, hint = nil) ⇒ HTTPError

Returns a new instance of HTTPError.



7
8
9
10
11
12
# File 'lib/harvest/errors.rb', line 7

def initialize(response, params = {}, hint = nil)
  @response = response
  @params = params
  @hint = hint
  super(response)
end

Instance Attribute Details

#hintObject (readonly)

Returns the value of attribute hint.



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

def hint
  @hint
end

#paramsObject (readonly)

Returns the value of attribute params.



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

def params
  @params
end

#responseObject (readonly)

Returns the value of attribute response.



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

def response
  @response
end

Instance Method Details

#to_sObject



14
15
16
17
# File 'lib/harvest/errors.rb', line 14

def to_s
  "#{self.class.to_s}: #{response.code} #{response.body}" +
    (hint ? "\n#{hint}" : "")
end