T
Todd A. Jacobs
I have a code segment which is intended to catch ResponseCodeError
exceptions from the mechanize library:
begin
# code
rescue ResponseCodeError
puts 'bad response code: ' + $!
end
This doesn't quite do what I need. What I really want is to display the
actual response code that mechanize is unhappy about, rather than just a
stack trace. According to the docs, WWW::Mechanize::ResponseCodeError
has an attribute named response_code, but I'm not sure I understand how
I access that within the exception handler.
exceptions from the mechanize library:
begin
# code
rescue ResponseCodeError
puts 'bad response code: ' + $!
end
This doesn't quite do what I need. What I really want is to display the
actual response code that mechanize is unhappy about, rather than just a
stack trace. According to the docs, WWW::Mechanize::ResponseCodeError
has an attribute named response_code, but I'm not sure I understand how
I access that within the exception handler.