Sha256: d4202836c51c83f3b1ff415dd1b2fd129d0e564c1a800190b2c734c586e5b2cd

Contents?: true

Size: 585 Bytes

Versions: 15

Compression:

Stored size: 585 Bytes

Contents

# 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.

class Mechanize::ResponseCodeError < Mechanize::Error
  attr_reader :response_code
  attr_reader :page

  def initialize(page)
    @page          = page
    @response_code = page.code.to_s
  end

  def to_s
    "#{@response_code} => #{Net::HTTPResponse::CODE_TO_OBJ[@response_code]}"
  end

  alias inspect to_s
end

Version data entries

15 entries across 15 versions & 4 rubygems

Version Path
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/mechanize-2.3/lib/mechanize/response_code_error.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/mechanize-2.3/lib/mechanize/response_code_error.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/mechanize-2.3/lib/mechanize/response_code_error.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/mechanize-2.3/lib/mechanize/response_code_error.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/mechanize-2.3/lib/mechanize/response_code_error.rb
mechanize-2.3 lib/mechanize/response_code_error.rb
mechanize-2.2.1 lib/mechanize/response_code_error.rb
mechanize-2.2 lib/mechanize/response_code_error.rb
mechanize-2.1.1 lib/mechanize/response_code_error.rb
domo-0.0.5 vendor/bundle/ruby/1.9.1/gems/mechanize-2.1/lib/mechanize/response_code_error.rb
diamond-mechanize-2.4 lib/mechanize/response_code_error.rb
diamond-mechanize-2.3 lib/mechanize/response_code_error.rb
diamond-mechanize-2.1 lib/mechanize/response_code_error.rb
mechanize-2.1 lib/mechanize/response_code_error.rb
mechanize-2.1.pre.1 lib/mechanize/response_code_error.rb