Sha256: 24509c58a1848cf12a738dc580b7a40c89a5295fed8c3218f9851de2d9a3ce20
Contents?: true
Size: 766 Bytes
Versions: 16
Compression:
Stored size: 766 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, message = nil) super message @page = page @response_code = page.code.to_s end def to_s response_class = Net::HTTPResponse::CODE_TO_OBJ[@response_code] out = "#{@response_code} => #{response_class} " out << "for #{@page.uri} " if @page.respond_to? :uri # may be HTTPResponse out << "-- #{super}" end alias inspect to_s end
Version data entries
16 entries across 16 versions & 2 rubygems