I have a code segment which is intended to catch ResponseCodeError
exceptions from the mechanize library:
puts 'bad response code: ’ + $!
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.