Exception: Mechanize::ResponseReadError

Inherits:
Error
  • Object
show all
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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error, response, body_io) ⇒ ResponseReadError

Creates a new ResponseReadError with the error raised, the response and the body_io for content read so far.



16
17
18
19
20
# File 'lib/mechanize/response_read_error.rb', line 16

def initialize error, response, body_io
  @error = error
  @response = response
  @body_io = body_io
end

Instance Attribute Details

#body_ioObject (readonly)

Returns the value of attribute body_io.



8
9
10
# File 'lib/mechanize/response_read_error.rb', line 8

def body_io
  @body_io
end

#errorObject (readonly)

Returns the value of attribute error.



9
10
11
# File 'lib/mechanize/response_read_error.rb', line 9

def error
  @error
end

#responseObject (readonly)

Returns the value of attribute response.



10
11
12
# File 'lib/mechanize/response_read_error.rb', line 10

def response
  @response
end

Instance Method Details

#messageObject

:nodoc:



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

def message # :nodoc:
  "#{@error.message} (#{self.class})"
end