Sha256: e34d29fc943fc883dfd45e2966166721cddc82ca880a0da9b6e4627f97a93f17
Contents?: true
Size: 808 Bytes
Versions: 17
Compression:
Stored size: 808 Bytes
Contents
# frozen_string_literal: true # 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 = String.new("#{@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
17 entries across 17 versions & 1 rubygems