"Filip Moens" <filip.moens / chello.be> writes:

> On my machine (Windows 2000), this problem indeed occurs with Ruby 1.6.6 and
> 1.6.7.
> The error is caugth correctly with Ruby 1.7.2.

It isn't really an error - a 'rescue' clause without specific
exceptions only catches exceptions of class StandardError and its
children.

On 1.6, NameError is a child of ScriptError, which is a child of the
base class Exception. Therefore, a simple 'rescue' won't catch
it. However

    rescue Exception

or

    rescue ScriptError

or

    rescue NameError

will.

Under 1.7, the exception hierarchy has changed. Now NameError's parent
is StandardError, and so it's caught by a default rescue clause.


Dave