On Wed, 30 Aug 2006, Ben Harper wrote:

> Why do I explicitly have to catch LoadError as thrown by 'require'?
>
> The following code demonstrates my problem:
> ------------------------------------------
> begin
> require 'not_existent'
> rescue
> print 'I am never reached'
> #rescue LoadError
> # print "But uncommenting these lines allows me to handle it"
> end
> ------------------------------------------

Oh, I am sorry.  I just work from a nap (long night) and misinterpreted 
that.

Because LoadError is not a subclass of StandardError.  A plain rescue 
catches StandardError and subclasses.


Kirk Haines