Exception: Mechanize::ResponseReadError
- Defined in:
- lib/mechanize/response_read_error.rb
Overview
Raised when Mechanize encounters an error while reading the response body from the server. Contains the response headers and the response body up to the error along with the initial error.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body_io ⇒ Object
readonly
Returns the value of attribute body_io.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#mechanize ⇒ Object
readonly
Returns the value of attribute mechanize.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#force_parse ⇒ Object
Converts this error into a Page, File, etc.
-
#initialize(error, response, body_io, uri, mechanize) ⇒ ResponseReadError
constructor
Creates a new ResponseReadError with the
error
raised, theresponse
and thebody_io
for content read so far. -
#message ⇒ Object
:nodoc:.
Constructor Details
#initialize(error, response, body_io, uri, mechanize) ⇒ ResponseReadError
Creates a new ResponseReadError with the error
raised, the response
and the body_io
for content read so far.
19 20 21 22 23 24 25 |
# File 'lib/mechanize/response_read_error.rb', line 19 def initialize error, response, body_io, uri, mechanize @body_io = body_io @error = error @mechanize = mechanize @response = response @uri = uri end |
Instance Attribute Details
#body_io ⇒ Object (readonly)
Returns the value of attribute body_io.
9 10 11 |
# File 'lib/mechanize/response_read_error.rb', line 9 def body_io @body_io end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
10 11 12 |
# File 'lib/mechanize/response_read_error.rb', line 10 def error @error end |
#mechanize ⇒ Object (readonly)
Returns the value of attribute mechanize.
11 12 13 |
# File 'lib/mechanize/response_read_error.rb', line 11 def mechanize @mechanize end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
12 13 14 |
# File 'lib/mechanize/response_read_error.rb', line 12 def response @response end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
13 14 15 |
# File 'lib/mechanize/response_read_error.rb', line 13 def uri @uri end |
Instance Method Details
#force_parse ⇒ Object
Converts this error into a Page, File, etc. based on the content-type
30 31 32 |
# File 'lib/mechanize/response_read_error.rb', line 30 def force_parse @mechanize.parse @uri, @response, @body_io end |
#message ⇒ Object
:nodoc:
34 35 36 |
# File 'lib/mechanize/response_read_error.rb', line 34 def # :nodoc: "#{@error.} (#{self.class})" end |