Exception: WWW::Mechanize::ResponseCodeError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- WWW::Mechanize::ResponseCodeError
- Defined in:
- lib/www/mechanize/response_code_error.rb
Overview
Synopsis
This error is thrown 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.
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#response_code ⇒ Object
readonly
Returns the value of attribute response_code.
Instance Method Summary collapse
-
#initialize(page) ⇒ ResponseCodeError
constructor
A new instance of ResponseCodeError.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(page) ⇒ ResponseCodeError
Returns a new instance of ResponseCodeError.
12 13 14 15 |
# File 'lib/www/mechanize/response_code_error.rb', line 12 def initialize(page) @page = page @response_code = page.code end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
10 11 12 |
# File 'lib/www/mechanize/response_code_error.rb', line 10 def page @page end |
#response_code ⇒ Object (readonly)
Returns the value of attribute response_code.
9 10 11 |
# File 'lib/www/mechanize/response_code_error.rb', line 9 def response_code @response_code end |
Instance Method Details
#inspect ⇒ Object
21 |
# File 'lib/www/mechanize/response_code_error.rb', line 21 def inspect; to_s; end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/www/mechanize/response_code_error.rb', line 17 def to_s "#{response_code} => #{Net::HTTPResponse::CODE_TO_OBJ[response_code]}" end |