Exception: Mechanize::RedirectLimitReachedError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/mechanize/redirect_limit_reached_error.rb

Overview

Thrown when too many redirects are sent

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page, redirects) ⇒ RedirectLimitReachedError

Returns a new instance of RedirectLimitReachedError.



5
6
7
8
9
# File 'lib/mechanize/redirect_limit_reached_error.rb', line 5

def initialize(page, redirects)
  @page           = page
  @redirects      = redirects
  @response_code  = page.code
end

Instance Attribute Details

#pageObject (readonly)

Returns the value of attribute page.



4
5
6
# File 'lib/mechanize/redirect_limit_reached_error.rb', line 4

def page
  @page
end

#redirectsObject (readonly)

Returns the value of attribute redirects.



4
5
6
# File 'lib/mechanize/redirect_limit_reached_error.rb', line 4

def redirects
  @redirects
end

#response_codeObject (readonly)

Returns the value of attribute response_code.



4
5
6
# File 'lib/mechanize/redirect_limit_reached_error.rb', line 4

def response_code
  @response_code
end

Instance Method Details

#to_sObject Also known as: inspect



11
12
13
# File 'lib/mechanize/redirect_limit_reached_error.rb', line 11

def to_s
  "Maximum redirect limit (#{redirects}) reached"
end