Methods

Mechanize::ResponseCodeError

This error is raised when Mechanize encounters a response code it does not know how to handle. Currently, this exception will be thrown if Mechanize encounters response codes other than 200, 301, or 302. Any other response code is up to the user to handle.

Attributes

response_code[R]
page[R]

Public Class Methods

new(page, message = nil) click to toggle source
    # File lib/mechanize/response_code_error.rb, line 10
10:   def initialize(page, message = nil)
11:     super message
12: 
13:     @page          = page
14:     @response_code = page.code.to_s
15:   end

Public Instance Methods

inspect() click to toggle source
Alias for: to_s
to_s() click to toggle source
    # File lib/mechanize/response_code_error.rb, line 17
17:   def to_s
18:     response_class = Net::HTTPResponse::CODE_TO_OBJ[@response_code]
19:     out = "#{@response_code} => #{response_class} "
20:     out << "for #{@page.uri} " if @page.respond_to? :uri # may be HTTPResponse
21:     out << "-- #{super}"
22:   end
Also aliased as: inspect

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.