Exception: Fetch::HttpError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, url) ⇒ HttpError

Returns a new instance of HttpError.



22
23
24
# File 'lib/fetch.rb', line 22

def initialize(code, url)
  @code, @url = code, url
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



20
21
22
# File 'lib/fetch.rb', line 20

def code
  @code
end

#urlObject (readonly)

Returns the value of attribute url.



20
21
22
# File 'lib/fetch.rb', line 20

def url
  @url
end

Instance Method Details

#messageObject



26
27
28
# File 'lib/fetch.rb', line 26

def message
  "HTTP Error #{code}: #{url}"
end