Exception: NetHTTPUtils::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/nethttputils.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body, code = nil) ⇒ Error

Returns a new instance of Error.



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

def initialize body, code = nil
  @code = code
  super "HTTP error ##{code} #{body}"
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



18
19
20
# File 'lib/nethttputils.rb', line 18

def code
  @code
end