puppetlabs/facter — pull request #362 by joshcooper (2012-11-29 17:57:10+00:00)
Title: (#17855) Rescue Timeout::Error

Previously, if the Facter::EC2.can_connect? method timed-out, an
instance of Timeout::Error would be raised. Under ruby 1.8.7, this class
is not a StandardError, and so wasn't rescued. And since the
can_connect? method is called when the ec2 code is loaded (as opposed to
a setcode block), the exception was never caught causing facter to exit.

In ruby 1.9.3, Timeout::Error is a StandardError, so the default
`rescue` block catches it.

This issue was caused by commit b336259e when trying to fix #17493.

This commit restores the explicit rescue of Timeout::Error so that it
behaves consistently on all supported ruby versions.