Exception: NetHTTPUtils::Error
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- NetHTTPUtils::Error
- Defined in:
- lib/nethttputils.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(body, code = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(body, code = nil) ⇒ Error
Returns a new instance of Error.
20 21 22 23 24 25 |
# File 'lib/nethttputils.rb', line 20 def initialize body, code = nil @code = code @body = body body = body[0...997] + "..." if body.size > 1000 super "HTTP error ##{code.inspect} #{body}" end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
19 20 21 |
# File 'lib/nethttputils.rb', line 19 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
18 19 20 |
# File 'lib/nethttputils.rb', line 18 def code @code end |