I've decided to add reCAPTCHA 'prove you're not a bot' to my signup
page, and plan on sprinkling it around in various places when people
want to post to forums, etc. I know I could use the thing that is
already written... but since a simple 'gem install recaptcha' does
not work, but instead needs a --source flag, I won't use it.
I also want to know what my code is doing, so I am writing my own.
In the verify method, I have:
It turns out I found the 'answer' I wrapped my http fetch with:
response = http.start do |http|
rescue Timeout::Error => e
return nil # XXXMLG this is ok for now...
This traps the Timeout::Error
Now, are there two classes of exceptions in Ruby? An exception that
is trapped using the normal
block and one that is not unless you specifically name it?
doesn't actually mean rescue everything. It means rescue everything
that derives from StandardError, which apparently Timeout::Error
doesn't. To rescue truely everything, you need rescue Exception. (see