Todd A. Jacobs
6/13/2007 6:04:00 AM
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.
--
"Oh, look: rocks!"
-- Doctor Who, "Destiny of the Daleks"